private void cleanup() {
        try
        {
            if (this.inputListener.isAlive())
            {
                this.inputListener.interrupt();
            }
            
            if (!this.socket.isInputShutdown())
            {
                this.socket.getInputStream().close();
            }
            if (!this.socket.isOutputShutdown())
            {
                this.socket.getOutputStream().close();
            }
            if (!this.socket.isClosed())
            {
                this.socket.close();
            }
        }
        catch (Exception e)
        {
            
        }
        finally
        {
            this.notifyClientDisconnected();
        }
    }