Type of socket

Started by
1 comment, last by hplus0603 16 years, 3 months ago
For network programming in winsock, for a multipayer game, which is the best to use? I have heard a lot about using non-blocking and Asynchronous, which should be used? If you wondering about the genre of the game, can you say specfically per genre (MMO, RTS & FPS are the ones I am looking at).
Advertisement
From what I see (haven't actually tested each one under many different scenarios) this does not really depend on the kind of game. With games with lower numbers of connections, simple blocking socket I/O will suffice. Though if you want a larger number of active connections, you're going to want to use a more efficient management system, such as asynchronous sockets. If using .NET, this is a very easy task. When it comes to MMO-size server, many will strongly suggest looking at IOCP if the backbone server is using Windows and has multiple processors / a processor have multiple cores.

Asynchronous sockets are better than non-blocking performance-wise due to the fact that you do not have to constantly poll them. Instead, you will be "told" when an event happens, and its up to you to decide when to take care of it.
NetGore - Open source multiplayer RPG engine
The Forum FAQ talks about this.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement