コード例 #1
0
 private static void DemuxFailureHandlerCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         DuplexSessionDemuxFailureAsyncResult asyncState = (DuplexSessionDemuxFailureAsyncResult)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             asyncState.demuxFailureHandler.EndHandleDemuxFailure(result);
             flag = asyncState.OnDemuxFailureHandled();
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             flag      = true;
             exception = exception2;
         }
         if (flag)
         {
             asyncState.Complete(false, exception);
         }
     }
 }
コード例 #2
0
 private static void ChannelCloseCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         DuplexSessionDemuxFailureAsyncResult asyncState = (DuplexSessionDemuxFailureAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.channel.EndClose(result);
             asyncState.message.Close();
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         asyncState.Complete(false, exception);
     }
 }