@Override
    public void run() {
        try {
            ss = new ServerSocket(port);
            System.out.println("Listening on " + ss);
            while (true) {
                Socket s = ss.accept();
                if (!bannedAddresses.contains(s.getInetAddress())) {
                    System.out.println("Connection from " + s);
                    DataOutputStream dout = new DataOutputStream(s.getOutputStream());
                    DataInputStream din = new DataInputStream(s.getInputStream());
                    String nickname = din.readUTF();
                    Connection connection = new Connection(s, dout, din, nickname);
                    unauthenticatedClients.add(connection);
                    ServerThread serverThread = new ServerThread(this, connection).start();
                } else {
                    DataOutputStream dout = new DataOutputStream(s.getOutputStream());
                    dout.writeUTF("5Connection refused becuase you are banned.");
                    dout.writeUTF("7");
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
        }
    }