public bool HardProtocolExceptionHandler(HardProtocolException hpe)
        {
            if (SetCloseReason(hpe.ShutdownReason))
            {
                OnShutdown();
                m_session0.SetSessionClosing(false);
                try
                {
                    m_session0.Transmit(ConnectionCloseWrapper(
                                            hpe.ShutdownReason.ReplyCode,
                                            hpe.ShutdownReason.ReplyText));
                    return(true);
                }
                catch (IOException ioe)
                {
                    LogCloseError("Broker closed socket unexpectedly", ioe);
                }
            }
            else
            {
                LogCloseError("Hard Protocol Exception occured "
                              + "while closing the connection", hpe);
            }

            return(false);
        }
        public bool HardProtocolExceptionHandler(HardProtocolException hpe)
        {
            if (SetCloseReason(hpe.ShutdownReason))
            {
                OnShutdown();
                m_session0.SetSessionClosing(false);
                try
                {
                    m_session0.Transmit(ConnectionCloseWrapper(
                                           hpe.ShutdownReason.ReplyCode,
                                           hpe.ShutdownReason.ReplyText));
                    return true;
                } catch (IOException ioe) {
                    LogCloseError("Broker closed socket unexpectedly", ioe);
                }

            } else
                LogCloseError("Hard Protocol Exception occured "
                              + "while closing the connection", hpe);

            return false;
        }