public Client(ClientHandler handler, Socket clientSocket, int idleTimeout, int max, String ruleFile, String username, String password) throws IOException {
    	Client.numberOfConnections++;
    	if(ClientValidator.isAllowed(clientSocket.getInetAddress(), ruleFile)) {
        	this.handler = handler;
        	this.clientSocket = clientSocket;
        	this.outputStream = clientSocket.getOutputStream();
        	this.username = username;
        	this.password = password;
        	this.greeted = false;
        	this.connected = false;
        	this.connectionTime = System.currentTimeMillis();
        	this.bytesSent = 0;
        	this.contentLength = -1;
        	this.maxNumberOfClients = max;
    		this.idle = true;
    		this.idleTimeout = idleTimeout;
        	this.hostname = clientSocket.getInetAddress().getCanonicalHostName();
        	this.engine = new Thread(this, "Client Engine");
    		engine.start();
    	}
    	else {
    		clientSocket.close();
    	}
    }