コード例 #1
0
ファイル: Pop3Client.cs プロジェクト: c0d3l0g1c/Skycap-Mail
        public virtual Pop3Response Logout()
        {
            lock (this)
            {
                if (this.State != EPop3ClientState.Awaiting)
                {
                    throw new InvalidOperationException("Pop3Client doesn't allow executing multiple operations simulteneously in a few threads using one object");
                }
                this.State = EPop3ClientState.Busy;
            }
            Pop3Response response = new Pop3Response("+OK");

            if (this.ConnectionState != EPop3ConnectionState.Disconnected)
            {
                QUIT command = new QUIT();
                response = this.DoCommand(command);
                if (this.Quit != null)
                {
                    this.Quit(this);
                }
                this.ConnectionState = EPop3ConnectionState.Disconnected;
                if (Disconnected != null)
                {
                    Disconnected(this);
                }
                try
                {
                    this._connection.Close();
                }
                catch (Exception exception)
                {
                    this.HandleException(exception);
                    throw;
                }
            }
            this.State = EPop3ClientState.Awaiting;
            return(response);
        }
コード例 #2
0
 public QUITHandler(ISession client, ChatCommandBase cmd) : base(client, cmd)
 {
     _cmd = (QUIT)cmd;
 }