示例#1
0
        private void BeginExecuteCallBack(IAsyncResult result)
        {
            AsynchronousPop3ResponseContext cx = (AsynchronousPop3ResponseContext)result.AsyncState;
            Boolean IsException = false;

            try
            {
                Int32 size = this._Stream.EndRead(result);
                if (cx.ReadBuffer(size) == true)
                {
                    this._Stream.BeginRead(cx.Buffer.Array, 0, cx.Buffer.Array.Length, this.BeginExecuteCallBack, cx);
                }
                else
                {
                    cx.OnEndGetResponse();
                    cx.Dispose();
                }
            }
            catch
            {
                IsException = true;
                throw;
            }
            finally
            {
                if (IsException == true && cx != null)
                {
                    cx.Dispose();
                }
            }
        }