NonblockingServerExample -- a simple concurrent server that spawns one thread per client request, so that it doesn't block while waiting for requests.
To see this example in action:
  1. Compile the Java source file, NonblockingServerExample.java:
    	javac NonblockingServerExample.java
    
  2. Run the class on one machine:
    	java NonblockingServerExample
    
  3. On a separate machine, or in a separate command line window, run the client class as a separate program. The final arguement, server-host-machine, should name the machine on which your server process is running:
    	java ClientToNonblockingServer server-host-machine
    
  4. Start more than one connection at a time, if possible.

The source.