Beispiel #1
0
 private static void ReadCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         Exception exception = null;
         SmtpReplyReaderFactory.ReadLinesAsyncResult asyncState = (SmtpReplyReaderFactory.ReadLinesAsyncResult)result.AsyncState;
         try
         {
             asyncState.read = asyncState.parent.bufferedStream.EndRead(result);
             if (asyncState.ProcessRead())
             {
                 asyncState.Read();
             }
         }
         catch (Exception exception2)
         {
             exception = exception2;
         }
         if (exception != null)
         {
             asyncState.InvokeCallback(exception);
         }
     }
 }
Beispiel #2
0
 internal static LineInfo[] End(IAsyncResult result)
 {
     SmtpReplyReaderFactory.ReadLinesAsyncResult result2 = (SmtpReplyReaderFactory.ReadLinesAsyncResult)result;
     result2.InternalWaitForCompletion();
     return((LineInfo[])result2.lines.ToArray(typeof(LineInfo)));
 }