diff --git a/examples/src/TcpExamples/TcpExample1Telnet.java b/examples/src/TcpExamples/TcpExample1Telnet.java index 65afb1959f0a8ee33c81220916baa5921e3fe94c..074e545611945ef692b52f395c4d0496489b7837 100644 --- a/examples/src/TcpExamples/TcpExample1Telnet.java +++ b/examples/src/TcpExamples/TcpExample1Telnet.java @@ -64,7 +64,8 @@ public class TcpExample1Telnet } catch(IOException e) { - System.out.println("*** Problem with networking: " + e); + System.out.println("Problem with TcpExample1Telnet networking:"); // describe what is happening + System.out.println("Error: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException) System.out.println("*** Be sure to stop any other running instances of programs using this port!"); diff --git a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java index 9ab0e481be1c5f78075e8fe99701b75bde161c91..6dfcf88e81c6ba9f73361c6fa9ee83e6d01eb0d1 100644 --- a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java +++ b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java @@ -84,7 +84,8 @@ public class TcpExample2ConnectionCounting } catch(IOException e) { - System.out.println("problem with networking: " + e); + System.out.println("Problem with TcpExample2ConnectionCounting networking:"); // describe what is happening + System.out.println("Error: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException) System.out.println("*** Be sure to stop any other running instances of programs using this port!"); diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java index 422c16234c4c328c0c9688efbd8d0a647bb1af05..2824b80b4b8ac7d5a267e2c753c02a28b6e10a56 100644 --- a/examples/src/TcpExamples/TcpExample3Client.java +++ b/examples/src/TcpExamples/TcpExample3Client.java @@ -46,8 +46,8 @@ public class TcpExample3Client { } // end while(true) } catch (IOException e) { - System.out.println("Problem with client: "); // describe what is happening - System.out.println(e); + System.out.println("Problem with TcpExample3ServerClient networking:"); // describe what is happening + System.out.println("Error: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException) System.out.println("*** Be sure to stop any other running instances of programs using this port!"); diff --git a/examples/src/TcpExamples/TcpExample3Server.java b/examples/src/TcpExamples/TcpExample3Server.java index f6c15238289768e38cd48f737accf21f80286a44..92e5db879863187aaabe9ae0bad24174587112fd 100644 --- a/examples/src/TcpExamples/TcpExample3Server.java +++ b/examples/src/TcpExamples/TcpExample3Server.java @@ -73,7 +73,7 @@ public class TcpExample3Server { } catch (IOException e) { - System.out.println("problem with networking"); + System.out.println("Problem with TcpExample3Server networking: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException) System.out.println("*** Be sure to stop any other running instances of programs using this port!"); diff --git a/examples/src/TcpExamples/TcpExample4Client.java b/examples/src/TcpExamples/TcpExample4Client.java index 9b734a05c0ba584a35d66fb643747ae8df28b8f2..c5049c45374e5ba9b3a45d775a6ff8d5a0c59d25 100644 --- a/examples/src/TcpExamples/TcpExample4Client.java +++ b/examples/src/TcpExamples/TcpExample4Client.java @@ -45,7 +45,7 @@ public class TcpExample4Client long readTime = System.currentTimeMillis(); long timeLength = readTime - startTime; - System.out.println("TcpExample4Client: message received from server=" + serverMessage); + System.out.println("TcpExample4Client: message received from server='" + serverMessage + "'"); System.out.println("TcpExample4Client: time msec required for read=" + timeLength); System.out.println("=================================================="); // To push this further, launch multiple copies of TcpExample4Client simultaneously @@ -54,8 +54,8 @@ public class TcpExample4Client } catch(IOException e) { - System.out.println("Problem with TcpExample4Client, see exception trace:"); - System.out.println(e); + System.out.println("Problem with TcpExample4Client networking:networking:"); // describe what is happening + System.out.println("Error: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException) System.out.println("*** Be sure to stop any other running instances of programs using this port!"); diff --git a/examples/src/TcpExamples/TcpExample4HandlerThread.java b/examples/src/TcpExamples/TcpExample4HandlerThread.java index b8c93afd11d86347ccf47b7ae34f554085574a41..8518f02a8066111ab52396850d499dd939f0464b 100644 --- a/examples/src/TcpExamples/TcpExample4HandlerThread.java +++ b/examples/src/TcpExamples/TcpExample4HandlerThread.java @@ -49,15 +49,15 @@ public class TcpExample4HandlerThread extends Thread System.out.println("TcpExample4HandlerThread pausing for TIMEOUT=" + TIMEOUT + "ms"); // debug Thread.sleep(TIMEOUT); // 10 seconds - ps.println("This was written by the server TcpExample4HandlerThread"); + ps.println("This message was written by the server TcpExample4HandlerThread"); ps.flush(); socket.close(); System.out.println("TcpExample4HandlerThread finished handling a thread, now exit."); } catch(IOException | InterruptedException e) // either a networking or a threading problem { - System.out.println("Problem with TcpExample4HandlerThread, see exception trace:"); - System.out.println(e); + System.out.println("Problem with TcpExample4HandlerThread networking:"); // describe what is happening + System.out.println("Error: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException) System.out.println("*** Be sure to stop any other running instances of programs using this port!"); diff --git a/examples/src/TcpExamples/TcpExample4ThreadServer.java b/examples/src/TcpExamples/TcpExample4ThreadServer.java index bb47074f78936bd29645ecd63ce0720e5eb4e0ec..131b0e397b5c1dfbc283b212643a4907c98bbc1c 100644 --- a/examples/src/TcpExamples/TcpExample4ThreadServer.java +++ b/examples/src/TcpExamples/TcpExample4ThreadServer.java @@ -34,7 +34,7 @@ public class TcpExample4ThreadServer { } catch(IOException e) { - System.out.println("Problem with TcpExample4ThreadServer, see exception trace:"); + System.out.println("Problem with TcpExample4ThreadServer networking:"); // describe what is happening System.out.println("Error: " + e); // Provide more helpful information to user if exception occurs due to running twice at one time if (e instanceof java.net.BindException)