digitalmars.D - Windows Socket Timeout
- Evan Davis (14/14) Mar 22 2012 Hi, I'm trying to write a game sever/client architecture in D,
- Paulo Pinto (5/17) Mar 22 2012 If you really want performant sockets on Windows, you need to make use
- David Nadlinger (4/8) Mar 22 2012 Depending on what you are trying to achieve, you could always
- James Miller (7/14) Mar 22 2012 Ideally, no matter what platform you're on, you want some form of
Hi, I'm trying to write a game sever/client architecture in D, but I keep running into problems with the timeouts for windows sockets. On the std.socket documentation page it states that you can't set a timeout smaller than 500ms, and I've been experiencing this problem first hand. The problem is that I am trying to interlace sending packets with receiving packets, and I can't do that at 60 FPS without having a low timeout. Two questions: First, can you use select() on UDP sockets? Second, would it be feasible to have two different sockets instead, and use the REUSEADDR option? I'm somewhat worried about client-side cheating. Thanks for any thoughts, Evan Davis
Mar 22 2012
Am 22.03.2012 22:09, schrieb Evan Davis:Hi, I'm trying to write a game sever/client architecture in D, but I keep running into problems with the timeouts for windows sockets. On the std.socket documentation page it states that you can't set a timeout smaller than 500ms, and I've been experiencing this problem first hand. The problem is that I am trying to interlace sending packets with receiving packets, and I can't do that at 60 FPS without having a low timeout. Two questions: First, can you use select() on UDP sockets? Second, would it be feasible to have two different sockets instead, and use the REUSEADDR option? I'm somewhat worried about client-side cheating. Thanks for any thoughts, Evan DavisIf you really want performant sockets on Windows, you need to make use of the Windows specific APIs, and use IO completion ports not select. -- Paulo
Mar 22 2012
On Thursday, 22 March 2012 at 23:36:03 UTC, Paulo Pinto wrote:If you really want performant sockets on Windows, you need to make use of the Windows specific APIs, and use IO completion ports not select.Depending on what you are trying to achieve, you could always consider using enet or (parts of) RakNet. David
Mar 22 2012
On 23 March 2012 12:52, David Nadlinger <see klickverbot.at> wrote:On Thursday, 22 March 2012 at 23:36:03 UTC, Paulo Pinto wrote:Ideally, no matter what platform you're on, you want some form of non-blocking or asynchronous networking. The easiest way would be a seperate thread for all networking logic. Especially since you should probably have a separate thread for your rendering code anyway. -- James MillerIf you really want performant sockets on Windows, you need to make use of the Windows specific APIs, and use IO completion ports not select.Depending on what you are trying to achieve, you could always consider using enet or (parts of) RakNet. David
Mar 22 2012