Exemple #1
0
 private static void OnSessionOpenComplete(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ReliableChannelOpenAsyncResult asyncState = (ReliableChannelOpenAsyncResult)result.AsyncState;
         Exception e = null;
         try
         {
             asyncState.session.EndOpen(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             e = exception2;
         }
         if (e != null)
         {
             asyncState.CloseBinderAndComplete(e);
         }
         else
         {
             asyncState.Complete(false);
         }
     }
 }
Exemple #2
0
 private static void OnBinderOpenComplete(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ReliableChannelOpenAsyncResult asyncState = (ReliableChannelOpenAsyncResult)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             flag = asyncState.CompleteBinderOpen(false, result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         if (flag)
         {
             asyncState.Complete(false, exception);
         }
         else if (exception != null)
         {
             asyncState.CloseBinderAndComplete(exception);
         }
     }
 }