Note that this server is intended as a starting point, not a finished
product. If you want to run it on your own system, there's still a
lot of work to do. Some things to add are:
Input buffering: I lied about the recv() function - it doesn't
always receive a line at a time. A real chat server would need
to append the results of recv() to a buffer and split it into
lines by searching for line breaks.
Output buffering: If someone suspends their telnet process long
enough, calling send() could block it. But select()
can be used to find
out whether a socket is ready for writing.
Proper support for the telnet protocol
Commands to get help, list who's in the room, and log out