예제 #1
0
 private static void OpenChannelCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult asyncState = (SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult)result.AsyncState;
         bool      flag = false;
         Exception e    = null;
         try
         {
             asyncState.channel.EndOpen(result);
             flag = asyncState.OnChannelOpened();
             if (flag)
             {
                 asyncState.OnOperationComplete();
             }
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             flag = true;
             e    = exception2;
             asyncState.OnOperationFailure(e);
         }
         if (flag)
         {
             asyncState.Complete(false, e);
         }
     }
 }
예제 #2
0
 private static void CloseChannelCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult asyncState = (SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult)result.AsyncState;
         Exception e = null;
         try
         {
             asyncState.channel.EndClose(result);
             asyncState.OnOperationComplete();
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             e = exception2;
             asyncState.OnOperationFailure(e);
         }
         asyncState.Complete(false, e);
     }
 }