for (Enumeration i = connections.elements(); i.hasMoreElements();) { final Connection conn = (Connection)i.nextElement(); send(conn.getId(), new Packet(Packet.COMMAND_CLOSE_CONNECTION)); }
    public void die() {        // kill thread accepting new connections        connector = null;        // close socket        try {            serverSocket.close();        } catch(IOException ex) { ; }        // kill pending connnections        for (Enumeration i = connectionsPending.elements(); i.hasMoreElements();) {            final Connection conn = (Connection)i.nextElement();            conn.die();        }        connectionsPending.removeAllElements();        // kill active connnections        for (Enumeration i = connections.elements(); i.hasMoreElements();) {            final Connection conn = (Connection)i.nextElement();            conn.die();        }        connections.removeAllElements();        connectionIds.clear();    }