Winsock multiplexing, IOCP vs overlapped

03/23/2012 15:47 KraHen#1
I am aware that I will probably get flamed for this, perhaps trivial question, I realize that I`m pretty much new to these concepts, and I don`t grasp them as I would like to yet.

I am doing some winsock practice, and I would like to implement an actual server architecture using it, and I am debating between the iocp and the overlapped models. I understand that IOCP provides better performance, but if I`m right, which I`m unsure of, the overlapped i/o technique would provide greater scalability on long term, which would affect performance as well on larger scales. I`m still giving IOCP a better mark, but I`d like to ask wht you guys think about this.
03/23/2012 23:16 Spirited#2
You can always make a pre-compiler, conditional directive and just have both of them working in your source. That way, if your server ends up getting larger, you can just switch between them. I'd definitely go with the overlap model though (personally). The overlap model is built for multiple asynchronous connections. It'd be perfect for any (large) game server. This is C++ you're talking about, right?
03/24/2012 14:19 KraHen#3
We`re both idiots I guess, because it turns out that you have to use IOCP in an overlapped context. :))
03/24/2012 15:02 CptSky#4
It may be interesting to read: [Only registered and activated users can see links. Click Here To Register...]

Talk of major I/O strategies for Winsock.
03/24/2012 15:42 KraHen#5
I`m right now working on a multithreaded implementation based on IOCP so I can handle sockets asynchronously without WSAAsyncSelect and overlapped sockets of course, so the maximal amount of threads spawned will be NUMBER_OF_PROCESSORS * 2, and it scales pretty well as far as I can tell. :)

Also turns out that Boost provides a pretty robust networking interface as well, which is cross platform too, so I might as well just use that.