Skip to content
Snippets Groups Projects
Commit 6eb529a9 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

warn if main() method invoked, not supported

parent d35dc6fb
No related branches found
No related tags found
No related merge requests found
...@@ -31,9 +31,9 @@ public class TcpExample4HandlerThread extends Thread ...@@ -31,9 +31,9 @@ public class TcpExample4HandlerThread extends Thread
/** The socket connection to a client */ /** The socket connection to a client */
Socket socket; Socket socket;
/** The thread constructor creates the socket from /**
* a ServerSocket, and passes one to the thread * The thread constructor creates the socket from a ServerSocket, waiting for the client to connect,
* responsible for handling the connection. * and passes that socket when constructing the thread responsible for handling the connection.
* *
* @param socket The socket connection handled by this thread * @param socket The socket connection handled by this thread
*/ */
...@@ -41,6 +41,15 @@ public class TcpExample4HandlerThread extends Thread ...@@ -41,6 +41,15 @@ public class TcpExample4HandlerThread extends Thread
{ {
this.socket = socket; 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 /** Handles one connection. We add an artificial slowness
* to handling the connection with a sleep(). This means * to handling the connection with a sleep(). This means
......
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