3 ms·
The link is about FPS networking so not really applicable to what you are doing, but an interesting read non the less. http://developer.valvesoftware.com/wiki/S
by stonemetal 15y ago
The link is about FPS networking so not really applicable to what you are doing, but an interesting read non the less.
http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking http://developer.valvesoftware.com/wiki/Source_Multiplayer_N...
I am spinning up a TCPServer which spins up a thread for each socket connection. I know this is just for learning purposes but this really isn't the way to do it. Use select or your platform specific enhanced version(kqueue, epoll, IO completion ports.)
I would probably have a separate communication thread handling all your sockets(with select) with two queues of messages, one for each direction. While the main thread handles processing messages.
This is probably a little too entry level but it makes a good reference.
http://beej.us/guide/bgnet/ http://beej.us/guide/bgnet/