@@ -85,7 +85,7 @@ public class Server {
|
||||
private void start() {
|
||||
System.out.println("Server started.");
|
||||
try {
|
||||
while (true) {
|
||||
while (networkServer.isAvailable()) {
|
||||
NetworkHandler.NetworkConnection<String> connection = networkServer.waitForConnection();
|
||||
ServerConnectionHandler connectionHandler = new ServerConnectionHandler(connection, connections);
|
||||
new Thread(connectionHandler).start();
|
||||
|
||||
@@ -62,10 +62,8 @@ public class ServerConnectionHandler extends ConnectionHandler implements Runnab
|
||||
/**
|
||||
* Constructor to initialize the connection
|
||||
*
|
||||
* @param connection representing the socket connection between server and client
|
||||
* @param registry map containing all active connections between server and clients
|
||||
|
||||
|
||||
* @param connection representing the socket connection between server and client
|
||||
* @param registry map containing all active connections between server and clients
|
||||
*/
|
||||
public ServerConnectionHandler(NetworkHandler.NetworkConnection<String> connection,
|
||||
Map<String, ServerConnectionHandler> registry) {
|
||||
|
||||
Reference in New Issue
Block a user