I'm writing a toy MUD/chat server to learn more about socket programming and C++, but I'm having trouble with getting client input.
I can start the server and then connect to it with telnet, but only the first message I send to the server is ever read and output; I don't know why.
This function loops in a while(1) after all the initialization is done, and is supposed to handle new clients connecting as well as client input.
http://pastebin.com/XmYLAKRy
Client:
Server output:telnet localhost 6000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stuff
and more stuff
some more stuff
Player connecting.
Adding player on fd 4.
Player input: stuff