@Override
    public void run() {
        if (client != null) {
            try {
                client.getClient().halt();
            } catch (IOException e) {
                System.err.println("Could not close client: " + e.getMessage());
            }
            client.dispose();
        }
        if (server != null) {
            server.halt();
        }
    }