diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java index 7312d3aac7f8aacf27abd5ca77d4c299b0867044..527f9ce2ddd16438dae8f742123bc2cd664bc928 100644 --- a/examples/src/TcpExamples/TcpExample3Client.java +++ b/examples/src/TcpExamples/TcpExample3Client.java @@ -97,6 +97,10 @@ public class TcpExample3Client if (e instanceof java.net.BindException) { System.err.println("*** Be sure to stop any other running instances of programs using this port!"); } + else if (e instanceof java.net.ConnectException) + { + System.out.println("*** Be sure to start the server before starting the client!"); + } } finally // occurs after any other activity when shutting down { diff --git a/examples/src/TcpExamples/TcpExample4Client.java b/examples/src/TcpExamples/TcpExample4Client.java index 9e4030fe4e90493661e8a3619f247d8e37e55be6..4a7fdb6581c893a3ee5b655e0c570e27647b2e97 100644 --- a/examples/src/TcpExamples/TcpExample4Client.java +++ b/examples/src/TcpExamples/TcpExample4Client.java @@ -79,6 +79,10 @@ public class TcpExample4Client if (e instanceof java.net.BindException) { System.out.println("*** Be sure to stop any other running instances of programs using this port!"); } + else if (e instanceof java.net.ConnectException) + { + System.out.println("*** Be sure to start the server before starting the client!"); + } } } } diff --git a/examples/src/TcpExamples/TcpSentryScenarioClient.java b/examples/src/TcpExamples/TcpSentryScenarioClient.java index 71507b79d738d3451f3b6494a0387b5b226fb357..20f7fde61842524c520611f83b46070217ececf0 100644 --- a/examples/src/TcpExamples/TcpSentryScenarioClient.java +++ b/examples/src/TcpExamples/TcpSentryScenarioClient.java @@ -112,12 +112,17 @@ public class TcpSentryScenarioClient System.out.println(prefix + " complete"); // main method now exits } catch (IOException e) { - System.out.println("Problem with " + prefix + " networking:networking:"); // describe what is happening - System.out.println("Error: " + e); + System.out.println("*** Problem with " + prefix + "networking:"); // describe what is happening + 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) { + if (e instanceof java.net.BindException) + { System.out.println("*** Be sure to stop any other running instances of programs using this port!"); } + else if (e instanceof java.net.ConnectException) + { + System.out.println("*** Be sure to start the server before starting the client!"); + } } } }