public synchronized void close() {
        if (m_Dead) {
            return;
        } else {
            try {
                // connection dead
                m_Dead = true;
                // close i/o
                m_TerminalIO.close();
            } catch (Exception ex) {
                log.error("close()", ex);
                // handle
            }
            try {
                // close socket
                m_ConnectionData.getSocket().close();
            } catch (Exception ex) {
                log.error("close()", ex);
                // handle
            }
            try {
                // register closed connection in ConnectionManager
                m_ConnectionData.getManager().registerClosedConnection(this);
            } catch (Exception ex) {
                log.error("close()", ex);
                // handle
            }
            try {
                // try to interrupt it
                interrupt();
            } catch (Exception ex) {
                log.error("close()", ex);
                // handle
            }

            log.debug("Closed " + toString() + " and inactive.");
        }
    }// close