this is something I've been through a few times and after a short break I am coming back with an application for a client, but just want to remember a few things before I actually implement anything.
I will be speaking about a multi-client server here, that deals with clients connecting through TCP onto a server bound port.
I remember coding this by using select() , FD_ISSET, FD_ZERO, FD_SET - and it's family methods to accept and manage a list of connected clients on my server - and I remember it was working great, but this time it is about a simple 32 player RPG game - so nothing fast-paced, thus the TCP here.
Simple GO_TO packets, WEATHER change, TIME updates, TEXT messages, ITEM STATE CHANGES and QUITS, LOGINS ( broadcasts ) , and something else I can't find out now.
What stops me from sleeping today is what should I really choose to have this server running smoothly ( when speaking of it's networking performance ).
People tend to speak much about 'non-blocking' approach to sockets either by using ioctlsocket(..) or some other 'threading' weirdos, which do the thing but you have to controll them in a different style - and yes I have tried this, and have seen many approaches - which deal with many threads around in the application - what is kind of overcomplicated really..
I have seen those MSDN "ASYNCHROUNOUS" sockets too, where you get the messages from the socket - but this is too much I think.
So instead of coding I am thinking and would like to ask,
if select() can do the trick when speaking of a game server, handling let's say those 32 players simultanously. What I mean here is how do you think from your experience, will that do the thing? Or I would have to rollback at the end and modify the whole server code while closing to the deadline..
what exactly is the difference between doing select / ioctlsocket ?
what are the pros and cons for both methods ?
Many many thanks for any reply to this, I hope I am clear in what I am asking about.



















