diff --git a/examples/src/TcpExamples/TcpExample4Client.java b/examples/src/TcpExamples/TcpExample4Client.java index 29b996c84214dcc0463c88214dfa7bede9c463b5..9b734a05c0ba584a35d66fb643747ae8df28b8f2 100644 --- a/examples/src/TcpExamples/TcpExample4Client.java +++ b/examples/src/TcpExamples/TcpExample4Client.java @@ -56,6 +56,9 @@ public class TcpExample4Client { System.out.println("Problem with TcpExample4Client, see exception trace:"); System.out.println(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!"); } } } \ No newline at end of file diff --git a/examples/src/TcpExamples/TcpExample4HandlerThread.java b/examples/src/TcpExamples/TcpExample4HandlerThread.java index 8b51079dbf7d80ba3b894a9159b69ae6de78a626..b8c93afd11d86347ccf47b7ae34f554085574a41 100644 --- a/examples/src/TcpExamples/TcpExample4HandlerThread.java +++ b/examples/src/TcpExamples/TcpExample4HandlerThread.java @@ -58,6 +58,9 @@ public class TcpExample4HandlerThread extends Thread { System.out.println("Problem with TcpExample4HandlerThread, see exception trace:"); System.out.println(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 8d2c90eae22b0e08239f65e503877cd39614103c..bb47074f78936bd29645ecd63ce0720e5eb4e0ec 100644 --- a/examples/src/TcpExamples/TcpExample4ThreadServer.java +++ b/examples/src/TcpExamples/TcpExample4ThreadServer.java @@ -36,6 +36,9 @@ public class TcpExample4ThreadServer { { System.out.println("Problem with TcpExample4ThreadServer, see exception trace:"); 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!"); } System.out.println("============================================================="); }