diff --git a/examples/src/TcpExamples/TcpExample1Telnet.java b/examples/src/TcpExamples/TcpExample1Telnet.java index fd500650c4f4cb7c4669a7a68f421457f49f2926..bd93d56b132df1fac6fafb92beb377fc07e14d29 100644 --- a/examples/src/TcpExamples/TcpExample1Telnet.java +++ b/examples/src/TcpExamples/TcpExample1Telnet.java @@ -36,7 +36,7 @@ public class TcpExample1Telnet { try { - System.out.println("TcpExample1Telnet has started and is waiting for a connection."); + System.out.println(TcpExample1Telnet.class.getName() + " has started and is waiting for a connection."); System.out.println(" help: https://savage.nps.edu/Savage/developers.html#telnet"); System.out.println(" enter (telnet localhost 2317) or (nc localhost 2317)..." ); @@ -57,19 +57,19 @@ public class TcpExample1Telnet OutputStream os = clientConnection.getOutputStream(); PrintStream ps = new PrintStream(os); - ps.println("This client response was written by server TcpExample1."); // to remote clientnc - System.out.println("This server response was written by server TcpExample1."); // to server console + ps.println("This client response was written by server " + TcpExample1Telnet.class.getName()); // to remote clientnc + System.out.println("This server response was written by server " + TcpExample1Telnet.class.getName()); // to server console // "flush()" in important in that it forces a write // across what is in fact a slow connection ps.flush(); } - System.out.println("TcpExample1 completed successfully."); + System.out.println(TcpExample1Telnet.class.getName() + " completed successfully."); } catch(IOException e) { - System.err.println("Problem with TcpExample1Telnet networking:"); // describe what is happening - System.err.println("Error: " + e); + System.err.println("Exception with " + TcpExample1Telnet.class.getName() + " networking:"); // describe what is happening + System.err.println(e); // Provide more helpful information to user if exception occurs due to running twice at one time // brute force exception checking, can be brittle if exception message changes