Skip to content
Snippets Groups Projects
Commit b6057c2f authored by brutzman's avatar brutzman
Browse files

diagnostic comments

parent b8c9626c
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,9 @@ public class TcpExample1Telnet ...@@ -67,6 +67,9 @@ public class TcpExample1Telnet
System.out.println("Problem with TcpExample1Telnet networking:"); // describe what is happening System.out.println("Problem with TcpExample1Telnet networking:"); // describe what is happening
System.out.println("Error: " + e); System.out.println("Error: " + e);
// Provide more helpful information to user if exception occurs due to running twice at one time // 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
// if (e.getMessage().equals("Address already in use: NET_Bind"))
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!"); System.out.println("*** Be sure to stop any other running instances of programs using this port!");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment