public void disconnect() throws IOException {
        running = false;
        if(ishost == true) {
            serverSocket.close();
        } else {
            clientSocket.close();
        }
        ishost = false;
        playing = false;
        opponentready = false;
    }