I have a Class called Load Balancer which connects incoming clients to servers. So when a client is connected to the load balancer i add them to a list. And for every 5 new clients added, i want to create a new server instance. How do i translate this sentence into code?
Load balancer
connsock = loadBalancerSocket.accept();
//add connected client to the list
clients.add(connsock.getRemoteSocketAddress().toString());
//create server instance
SMTPserver server = new SMTPserver();
server.main();