private static void ReadCallback(object state)
                {
                    Microsoft.ServiceBus.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.OpenAsyncResult openAsyncResult = (Microsoft.ServiceBus.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.OpenAsyncResult)state;
                    bool      flag      = false;
                    Exception exception = null;

                    try
                    {
                        openAsyncResult.GetReadResult();
                        flag = openAsyncResult.ContinueReading();
                    }
                    catch (Exception exception2)
                    {
                        Exception exception1 = exception2;
                        if (Fx.IsFatal(exception1))
                        {
                            throw;
                        }
                        flag      = true;
                        exception = exception1;
                        openAsyncResult.CleanupOnError();
                    }
                    if (flag)
                    {
                        openAsyncResult.Complete(false, exception);
                    }
                }
                private static void OnWriteUpgradeResponse(IAsyncResult result)
                {
                    if (result.CompletedSynchronously)
                    {
                        return;
                    }
                    Microsoft.ServiceBus.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.OpenAsyncResult asyncState = (Microsoft.ServiceBus.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.OpenAsyncResult)result.AsyncState;
                    bool      flag      = false;
                    Exception exception = null;

                    try
                    {
                        flag = asyncState.HandleWriteUpgradeResponseComplete(result);
                        if (flag)
                        {
                            flag = asyncState.ContinueReading();
                        }
                    }
                    catch (Exception exception2)
                    {
                        Exception exception1 = exception2;
                        if (Fx.IsFatal(exception1))
                        {
                            throw;
                        }
                        exception = exception1;
                        flag      = true;
                        asyncState.CleanupOnError();
                        asyncState.channel.WriteAuditFailure(asyncState.channel.upgradeAcceptor as StreamSecurityUpgradeAcceptor, exception1);
                    }
                    if (flag)
                    {
                        asyncState.Complete(false, exception);
                    }
                }