public void close() {
        EIError.debugMsg("Closing");

        if (serverReceiveThread != null) {
            serverReceiveThread.setRunning(false);
        }

        if (socket != null) {
            try {
                sendData("goodbye");
                socket.close();
            } catch (IOException e) {
                //oh well, ain't no thang
            }
        }
        keepRunning = false;
        socket = null;
    }