Esempio n. 1
0
            private static void WaitOverCallback(object state, Exception asyncException)
            {
                SessionChannelDemuxer <TInnerChannel, TInnerItem> .OpenAsyncResult result = (SessionChannelDemuxer <TInnerChannel, TInnerItem> .OpenAsyncResult)state;
                bool      flag      = false;
                Exception exception = asyncException;

                if (exception != null)
                {
                    flag = true;
                }
                else
                {
                    try
                    {
                        flag = result.OnWaitOver();
                    }
                    catch (Exception exception2)
                    {
                        if (Fx.IsFatal(exception2))
                        {
                            throw;
                        }
                        flag      = true;
                        exception = exception2;
                    }
                }
                if (flag)
                {
                    result.Cleanup();
                    result.Complete(false, exception);
                }
            }
Esempio n. 2
0
 private static void OpenListenerCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SessionChannelDemuxer <TInnerChannel, TInnerItem> .OpenAsyncResult asyncState = (SessionChannelDemuxer <TInnerChannel, TInnerItem> .OpenAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.OnEndInnerListenerOpen(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         if (exception != null)
         {
             asyncState.channelDemuxer.pendingExceptionOnOpen = exception;
         }
         asyncState.Cleanup();
         asyncState.Complete(false, exception);
     }
 }
Esempio n. 3
0
 private static void OnOpenCompleteStatic(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SessionChannelDemuxer <TInnerChannel, TInnerItem> .PeekAsyncResult asyncState = (SessionChannelDemuxer <TInnerChannel, TInnerItem> .PeekAsyncResult)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             flag = asyncState.HandleOpenComplete(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
             flag      = true;
         }
         if (flag)
         {
             asyncState.Complete(false, exception);
         }
     }
 }
Esempio n. 4
0
 private static void OnReceiveCompleteStatic(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SessionChannelDemuxer <TInnerChannel, TInnerItem> .PeekAsyncResult asyncState = (SessionChannelDemuxer <TInnerChannel, TInnerItem> .PeekAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.HandleReceiveComplete(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         asyncState.Complete(false, exception);
     }
 }