public static void main(String args[]) {
		try {
			server = new ServerSocket(port);
			
			System.out.println("Server Initialized!");
		} catch(IOException e) {
			e.printStackTrace();
		}
		
		while(true) {
			try {
				client = server.accept(); //Idles here until the next client connects
				int i;
				for(i = 0; i < maxClientsCount; i++) {
					if(threads[i] == null) {
						(threads[i] = new ClientThread(client, threads, ++count)).start(); //When it doesn, create a new ClientThread object and start a thread for it
						System.out.println("Client " + count + " connected");
						break;
					}
				}
				if(i == maxClientsCount) { //if the max amount of clients has been met
					BufferedOutputStream clientOut = new BufferedOutputStream(client.getOutputStream());
					OutputStreamWriter socketWriter = new OutputStreamWriter(clientOut);
					socketWriter.write("Server too busy. Try again later");
					System.out.println("Max amount of Clients reached. Ignoring client " + ++count);
					clientOut.close();
					socketWriter.close();
					client.close();
				}
			} catch(Exception e) {
				e.printStackTrace();
			}
		}
	}