Properly implements the chat example.
Implements flow control.