void Microsoft.ServiceBus.IDirectConnectionParent.Success(object sender, Socket socket)
        {
            DirectConnectionSession directConnectionSession = (DirectConnectionSession)sender;
            Guid id = directConnectionSession.Id;
            EventTraceActivity eventTraceActivity = new EventTraceActivity(id);

            lock (this.ThisLock)
            {
                this.connectionSessions.Remove(id.ToString());
            }
            try
            {
                directConnectionSession.Close(Microsoft.ServiceBus.ServiceDefaults.CloseTimeout);
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                if (Fx.IsFatal(exception))
                {
                    throw;
                }
                Fx.Exception.TraceHandled(exception, "DirectSocketListener.Success", eventTraceActivity);
                directConnectionSession.Abort();
            }
            this.socketQueue.EnqueueAndDispatch(new Microsoft.ServiceBus.Channels.SocketConnection(socket, this.bufferSize, eventTraceActivity));
        }
        void Microsoft.ServiceBus.IDirectConnectionParent.Failure(object sender, Exception exception)
        {
            DirectConnectionSession directConnectionSession = (DirectConnectionSession)sender;
            Guid id = directConnectionSession.Id;

            lock (this.ThisLock)
            {
                this.connectionSessions.Remove(id.ToString());
            }
            try
            {
                directConnectionSession.Close(Microsoft.ServiceBus.ServiceDefaults.CloseTimeout);
            }
            catch (Exception exception2)
            {
                Exception exception1 = exception2;
                if (Fx.IsFatal(exception1))
                {
                    throw;
                }
                EventTraceActivity eventTraceActivity = new EventTraceActivity(id);
                Fx.Exception.TraceHandled(exception1, "DirectSocketListener.Failure", eventTraceActivity);
                directConnectionSession.Abort();
            }
        }