@Override
    public void run() {
        System.out.println("TCP Thread started.");

        // falls Connection fehlschlägt, dann brich ab.
        if (!connectionToServerSuceeded()) return;

        // ask for name (mutltiple times).
        // wird erfolgreich, oder bricht mit storageService.stop() ab.
        registerName();

        //
        while (storageServices.isRunning()) {
            try {
                println(info());    // send the server an info command
                List<String> tokens = readFromServer(); //  get response
                updateLocalUserList(tokens);
                guiServices.refreshUserList();
                if(storageServices.isRunning())Thread.sleep(CLIENT_INFO_WAIT_MS);  // wait a few seconds
            } catch (Exception e) { // if anything goes wrong. safe-kill the app.
                e.printStackTrace();
                storageServices.stop();
            }
        }
        // if the app is supposed to stop, then close the resources
        sendByeToServer();
        closeAll();
    }