A simple example of client-server communication via sockets. Once the client establishes a successful connection with the server, the client can send messages to the server, which will be echoed back to the client.
Usage:
Server:
java EchoServer \<port-number\>
Client:
java EchoClient \<host-name\> \<port-number\>