This example will work with either EchoServer or ThreadedEchoServer.
Source code: EchoClient.java EchoServer.java ThreadedEchoServer.java