Copy Server.java and Client.java to your machine
Compile the files and run them:
1) javac Server.java
2) javac Client.java
3) java Server
You can now open a new terminal and start your client (java Client) in new terminal
Whatever message you type at client will be reflected on server. You can also try running multiple clients.
Copy UDPServer.java and UDPClient.java to your machine
Compile the files and run them:
1) javac UDPServer.java
2) javac UDPClient.java
3) java UDPServer
You can now open a new terminal and start your client (java UDPClient) in new terminal
Play with it!
For those who want to code in C for Programming assignments
Refer "Unix Network Programming" by Richard W Stevens.