While reading IceDragon2000''s post (which I wish I could answer, but I really know very little about the whole WSA set of functions
![](sad.gif)
), I started thinking about whether blocking/non-blocking sockets are appropriate in certain circumstances.
As I''ve said in my few posts to this board a couple months ago, I am interested (along with so many others) in the creation of an online RPG, and I''m getting curious if anyone out there has a suggestion on if blocking/non blocking sockets are more appropriate. I would think that, at least in the client software, non-blocking would be the best, since the game could go on handling the mouse, playing music, redrawing the screen, etc. while waiting for the data to finally get in.
But what about on the server end? I''m sort of torn there...the only MMORPG type software I have worked on is a server emulator for Ultima Online (
UOX) which used blocking sockets. However, the code wasn''t the most sophisticated thing ever. Since a server (IMHO) needs no graphical front end or anything, and could probably exist fine as a console app (server software needs to be *fast*, why give it any extra overhead at all in the form of a nice windows GUI?). Would the speed boost of being able to process AI and things while waiting a couple milliseconds for a socket to finish be worth it? I think by the time you have received the message that the socket is ready again and responded to that, you''ve basically made up that time you lost by not blocking.
Or (and my total ignornace of how Threads really work shows here, heh), could you maybe run your network code all in one thread and everything else (AI, etc) in another? Would they operate independantly, or does waiting for a socket to unblock halt the entire process, not just its thread?
I''d love it if anyone could help me through this
![](wink.gif)
Anthracks