clean up
This commit is contained in:
Andrin Fassbind
2022-04-16 22:09:56 +02:00
parent a189fedd76
commit 40e3e14666
7 changed files with 15 additions and 18 deletions
@@ -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) {