System.Net.Mail.SmtpConnection.EndFlush C# (CSharp) Method

EndFlush() private method

private EndFlush ( IAsyncResult result ) : void
result IAsyncResult
return void
        internal void EndFlush(IAsyncResult result)
        {
            _networkStream.EndWrite(result);
            _bufferBuilder.Reset();
        }

Usage Example

Example #1
0
        internal static IAsyncResult BeginSend(SmtpConnection conn, AsyncCallback callback, object state)
        {
            MultiAsyncResult multiResult = new MultiAsyncResult(conn, callback, state);

            multiResult.Enter();
            IAsyncResult writeResult = conn.BeginFlush(s_onWrite, multiResult);

            if (writeResult.CompletedSynchronously)
            {
                conn.EndFlush(writeResult);
                multiResult.Leave();
            }
            SmtpReplyReader reader = conn.Reader.GetNextReplyReader();

            multiResult.Enter();

            //this actually does a read on the stream.
            IAsyncResult result = reader.BeginReadLine(s_onReadLine, multiResult);

            if (result.CompletedSynchronously)
            {
                LineInfo info = reader.EndReadLine(result);
                if (!(multiResult.Result is Exception))
                {
                    multiResult.Result = info;
                }
                multiResult.Leave();
            }
            multiResult.CompleteSequence();
            return(multiResult);
        }
All Usage Examples Of System.Net.Mail.SmtpConnection::EndFlush