开发者

Windows IOCP - any advantage for single-socket application?

As I understand IOCP under Windows Server 2003/2008 and C++ programming, they are more-or-less the highest performance way to service either multiple sockets, instead of select, or to tie together multiple threads to service those requests.

If my program has but a single socket however, and given other constraints will generally read one packet, do work, then wait for another packet, does IOCP buy me anything?

It feels like just sitting in a recv() or equivalent开发者_如何学JAVA would be at least as fast, if not faster in this specific case?


Nope, in your case the extra complexity of IOCP doesn't sound warranted. At least, not unless you anticipate your program becoming more sophisticated in the near future...


No, in that situation IOCP is unlikely to add anything but complexity. Of course if you are already familiar with IOCP and you already have working code that you could use for this single connection system then there's no real reason not to use IOCP but if you've never used it before it wouldn't be worth the effort to learn it for a system such as you describe.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜