Esempio n. 1
0
 private static void OnRead(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         Base64Stream.ReadAsyncResult asyncState = (Base64Stream.ReadAsyncResult)result.AsyncState;
         try
         {
             if (!asyncState.CompleteRead(result))
             {
                 asyncState.Read();
             }
         }
         catch (Exception exception)
         {
             if (asyncState.IsCompleted)
             {
                 throw;
             }
             asyncState.InvokeCallback(exception);
         }
     }
 }
Esempio n. 2
0
 internal static int End(IAsyncResult result)
 {
     Base64Stream.ReadAsyncResult result2 = (Base64Stream.ReadAsyncResult)result;
     result2.InternalWaitForCompletion();
     return(result2.read);
 }