Now we have enough pieces to write our first chat server. The
conversations in this one aren't very interesting unless you enjoy
talking to yourself - whatever you say gets echoed back at you. But
it shows how to combine sockets and select() to create a server that can
do more than one thing at a time. Here's the source code.