@Override
    public void stopService() {
        try {
            deregisterFromServer();
        } catch (ConnectionException ex) {
            LOG.warning("Server could not be reached for deregistration.");
        }
        disconnectFromServer();

        try {
            if (serverSocket != null) {
                serverSocket.stopService();
            }
        } catch (Exception ex) {
            // error closing some resource, ignore
        }
        try {
            if (sdd != null) {
                sdd.stopService();
            }
        } catch (Exception ex) {
            // error closing some resource, ignore
        }
        LOG.info("Client has been stopped.");
    }