示例#1
0
            private static void OnChannelCloseCompleteStatic(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }
                ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult <TChannel, TItem> asyncState = (ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult <TChannel, TItem>)result.AsyncState;
                Exception exception = (Exception)null;

                try
                {
                    asyncState.HandleChannelCloseComplete(result);
                }
                catch (Exception ex)
                {
                    if (Fx.IsFatal(ex))
                    {
                        throw;
                    }
                    else
                    {
                        exception = ex;
                    }
                }
                asyncState.Complete(false, exception);
            }
示例#2
0
            private static void OnWaitForPendingOperationsCompleteStatic(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }
                ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult <TChannel, TItem> asyncState = (ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult <TChannel, TItem>)result.AsyncState;
                bool      flag      = false;
                Exception exception = (Exception)null;

                try
                {
                    flag = asyncState.HandleWaitForPendingOperationsComplete(result);
                }
                catch (Exception ex)
                {
                    if (Fx.IsFatal(ex))
                    {
                        throw;
                    }
                    else
                    {
                        exception = ex;
                    }
                }
                if (!flag && exception == null)
                {
                    return;
                }
                asyncState.Complete(false, exception);
            }
 private static void OnInputCompleteStatic(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult <TChannel, TItem> asyncState = (ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult <TChannel, TItem>)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             bool flag2;
             flag = asyncState.HandleInputComplete(result, out flag2);
             if (!flag && !flag2)
             {
                 flag = asyncState.WaitForEof();
             }
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         if (flag || (exception != null))
         {
             asyncState.Complete(false, exception);
         }
     }
 }