Skip to content

Commit

Permalink
telnet server module update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMartin committed Sep 23, 2024
1 parent ed3335f commit 34cf90b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions natt/src/main/java/utb/fai/natt/module/TelnetServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ public boolean sendSingleMessage(String message, String clientId) throws Interna
for (ClientHandler client : clients) {
if (client.getClientId().equals(clientId)) {
client.sendMessage(message);
logger.info(super.getNameForLogger() + "Message send: " + message);
logger.info(super.getNameForLogger() + "Sending a message to the client [" + clientId + "]: " + message);
return true;
}
}
} catch (IOException e) {
logger.warning(super.getNameForLogger() + "Failed to send message to clients: " + e.getMessage());
logger.warning(super.getNameForLogger() + "Failed to send message to client [" + clientId + "]: " + e.getMessage());
return false;
}
return false;
Expand All @@ -157,7 +157,7 @@ public ClientHandler(Socket clientSocket, String id, TelnetServer serverInstance
reader = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
writer = new PrintWriter(clientSocket.getOutputStream(), true);
} catch (IOException e) {
logger.warning(getNameForLogger() + "Failed to create telnet client handler: " + e.getMessage());
logger.warning(getNameForLogger() + "Failed to create telnet client [" + this.id + "] handler: " + e.getMessage());
}
}

Expand All @@ -173,7 +173,7 @@ public void run() {
this.serverInstance.notifyMessageListeners(this.id, inputLine);
}
} catch (IOException e) {
logger.info(getNameForLogger() + "Client disconnected");
logger.info(getNameForLogger() + "Client [" + this.id + "] disconnected");
} finally {
close();
}
Expand Down

0 comments on commit 34cf90b

Please sign in to comment.