diff --git a/examples/src/TcpExamples/TcpExample4HandlerThread.java b/examples/src/TcpExamples/TcpExample4HandlerThread.java index 2c3a128371e31e9a12b2bcdedb74bbedf5c7a54b..50d7a01e0f6a65efa83cee5fd935d5aa2f09a464 100644 --- a/examples/src/TcpExamples/TcpExample4HandlerThread.java +++ b/examples/src/TcpExamples/TcpExample4HandlerThread.java @@ -31,9 +31,9 @@ public class TcpExample4HandlerThread extends Thread /** The socket connection to a client */ Socket socket; - /** The thread constructor creates the socket from - * a ServerSocket, and passes one to the thread - * responsible for handling the connection. + /** + * The thread constructor creates the socket from a ServerSocket, waiting for the client to connect, + * and passes that socket when constructing the thread responsible for handling the connection. * * @param socket The socket connection handled by this thread */ @@ -41,6 +41,15 @@ public class TcpExample4HandlerThread extends Thread { this.socket = socket; } + /** + * Program invocation and execution starts here - but is illegal and unwanted, so warn the unsuspecting user! + * @param args command-line arguments + */ + public static void main(String[] args) + { + System.out.println ("*** TcpExample4HandlerThread is not a standalone executable progam."); + System.out.println ("*** Please run TcpExample4DispatchServer instead... now exiting."); + } /** Handles one connection. We add an artificial slowness * to handling the connection with a sleep(). This means