public void run() {
        setName(this.getClass().getSimpleName() + " [" + socket.getLocalSocketAddress() + "]");
        
        try {
            while (server.isRunning()) {
                Socket client = socket.accept();
                new ServerClientThread(client, server).start();
            }
        } catch (IOException e) {
            if (e instanceof SocketException && e.getMessage().equals("Socket closed") && server.isRunning() == false) {
                System.err.println("Server socket closed, shutting down.");
                return;
            }
            e.printStackTrace();
            return;
        }
    }