Ejemplo n.º 1
0
        public long GetMessageSize(int message)
        {
            if (m_CurrentState is DisconnectedState)
            {
                if (!Connect())
                {
                    return(-1);
                }
            }

            if (m_CurrentState is AuthorizationState)
            {
                if (!Authenticate())
                {
                    return(-2);
                }
            }

            RFC1939.ListCommand command = new RFC1939.ListCommand(m_Stream, message);
            if (IssueCommand(command))
            {
                return(command.List[0]);
            }
            return(-3);
        }
Ejemplo n.º 2
0
        public long[] ListMessages()
        {
            if (m_CurrentState is DisconnectedState)
            {
                if (!Connect())
                {
                    return new long[] { -1 }
                }
                ;
            }

            if (m_CurrentState is AuthorizationState)
            {
                if (!Authenticate())
                {
                    return new long[] { -2 }
                }
                ;
            }

            RFC1939.ListCommand command = new RFC1939.ListCommand(m_Stream);
            if (IssueCommand(command))
            {
                return(command.List);
            }
            return(new long[] { -3 });
        }