El código con el que inicio el servidor es este:
Código:
lo que contiene la clase es esto:String[] arguments = new String[] {};
new MultiThreadChatServerSync().main(arguments);
Código:
Se que se debe a que el while esta en espera de clientes y siempre esta bajo un bucle infinito, he intentado cambiando el while a estado false, pero solo permite un cliente y no me acepta los demas, bueno espero puedan ayudarme try {
serverSocket = new ServerSocket(portNumber);
} catch (IOException e) {
System.out.println(e);
}
while (true) {
try {
clientSocket = serverSocket.accept();
int i = 0;
for (i = 0; i < maxClientsCount; i++) {
if (threads[i] == null) {
(threads[i] = new clientThread(clientSocket, threads)).start();
break;
}
}
if (i == maxClientsCount) {
PrintStream os = new PrintStream(clientSocket.getOutputStream());
os.println("Los servidores estan ocupados, intenta mas tarde");
os.close();
clientSocket.close();
}
} catch (IOException e) {
System.out.println(e);
}
}
}
se los agradeceria mucho


