@Override
    public void run() // read server messages and act on them.
    {
        if (ip.isEmpty()) {
            doServer();
        } else {
            doClient();
        }

        return;
    }