Write a simulation of a chatting software. You're gonna need 4 classes:
Main: To set the whole thing up.
Server: Used to relay messages from ClientA to ClientB, and from ClientB to ClientA.
Clients A & B: These clients should have a two way pipe with the server. Both clients should send letters/words to the server at random time intervals, but should constantly read from the pipe in case they have received a message. Any messages that are sent/received should be printed on the screen. So for eg, the output will look something like this:
At *some date/time* Client A said: Blah!
At *some date/time* Client B received: Blah!
At *some date/time* Client A said: Oh no!
At *some date/time* Client B received: Oh no!
At *some date/time* Client B said: How's it going, eh?
At *some date/time* Client A received: How's it going, eh?
Do not have the clients chatting with each other directly. Have client A and B connect to servers through pipes. In the server, create two more pipes. One to link the output of A to the input of B and vice versa.