Class Server

java.lang.Object
  |
  +--Server
All Implemented Interfaces:
java.lang.Runnable

public class Server
extends java.lang.Object
implements java.lang.Runnable

This class accepts socket connections on the specified port and echoes messages sent to it by clients. Invoke this program from the command line with:

 java Server [-p port] [-v]
 

where:

-p port
is the port on which the server accepts connections. The default is 8000.
-v
enables verbose output in which the program prints each message received. The default is no verbose output.

Version:
15 Dec 2001
Author:
John Neffenger
See Also:
Client

Method Summary
static void main(java.lang.String[] args)
          Reads the command arguments and starts the test.
 void run()
          The body of the server test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public void run()
The body of the server test.

Specified by:
run in interface java.lang.Runnable

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Reads the command arguments and starts the test.

Parameters:
args - the command line arguments.
Throws:
java.io.IOException - when an error occurs creating the connection to the client.