if ( connected ) { send(new Packet(Packet.COMMAND_CLOSE_CONNECTION)); }
    public void die() {        connected = false;        pump = null;        // Tell all the displays to remove themselves as listeners.        boolean reportHandled = false;        Enumeration names = phaseComponents.keys();        while ( names.hasMoreElements() ) {            Component component = (Component) phaseComponents.get                ( names.nextElement() );            if ( component instanceof ReportDisplay ) {                if ( reportHandled ) {                    continue;                } else {                    reportHandled = true;                }            }            if ( component instanceof Distractable ) {                ( (Distractable) component ).removeAllListeners();            }        } // Handle the next component        // shut down threads & sockets        try {            frame.removeAll();            socket.close();            in.close();            out.close();        } catch (IOException e) {            e.printStackTrace();        } catch (NullPointerException e) {            // not a big deal, just never connected        }        frame.setVisible(false);/* Avoid the infinite loop until we can fix this bug!!!        boolean disposed = false;        while ( !disposed ) {*/        {            try {                frame.dispose();/*                disposed = true;*/            }            catch ( Throwable error ) {                error.printStackTrace();                System.err.println( "Attempting to close the InputContext in java.client.Client#die()..." );                try {                    curPanel.getInputContext().endComposition();                }                catch ( Throwable thr ) {                    thr.printStackTrace();                    frame.dispose();                }            }        }        System.out.println("client: died");    }