@Override
	public void run() {
		try {
			ServerSocket s = new ServerSocket(this.port);
			Socket clientsock = null;
			Client client;
		
			while (true) {
				try {
					client = new Client(this, clientsock = s.accept());
					System.out.println("Client connected");
					client.start();
					System.out.println("Client started");
					this.addClient(client);
				} catch (MalformedHeaderException ex) {
					if (clientsock != null && !clientsock.isClosed()) clientsock.close();
					Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
				}
			}
			
		} catch (IOException ex) {
			Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
		}
	}