예제 #1
0
            private static void OnWriteComplete(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }
                Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.CloseOutputSessionAsyncResult asyncState = (Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.CloseOutputSessionAsyncResult)result.AsyncState;
                Exception exception = null;

                try
                {
                    asyncState.HandleWriteEndBytesComplete(result);
                }
                catch (Exception exception2)
                {
                    Exception exception1 = exception2;
                    if (Fx.IsFatal(exception1))
                    {
                        throw;
                    }
                    exception = exception1;
                }
                asyncState.Cleanup(exception == null);
                asyncState.Complete(false, exception);
            }
예제 #2
0
            private static void OnEnterComplete(object state)
            {
                Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.CloseOutputSessionAsyncResult closeOutputSessionAsyncResult = (Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.CloseOutputSessionAsyncResult)state;
                bool      flag      = false;
                Exception exception = null;

                try
                {
                    flag = closeOutputSessionAsyncResult.WriteEndBytes();
                }
                catch (Exception exception2)
                {
                    Exception exception1 = exception2;
                    if (Fx.IsFatal(exception1))
                    {
                        throw;
                    }
                    flag      = true;
                    exception = exception1;
                }
                if (flag)
                {
                    closeOutputSessionAsyncResult.Cleanup(exception == null);
                    closeOutputSessionAsyncResult.Complete(false, exception);
                }
            }