On Windows 2000 and later versions, Winsock provides a mechanism for determining if an application is running behind in posting adequate AcceptEx calls. When creating the listening socket, associate it with an event by using the WSAEventSelect API call and registering for FD_ACCEPT notification. If there are no pending AcceptEx operations but there are incoming client connections (accepted by the system according to the backlog value), then the event will be signaled. This can even be used as an indication to post additional AcceptEx operations.
高并发服务器适时投递accept的方法
最新推荐文章于 2023-06-20 17:12:23 发布
本文深入探讨了在Windows 2000及后续版本中Winsock提供的用于判断应用程序是否在执行足够数量的AcceptEx调用的方法。通过在监听套接字上关联事件并注册FD_ACCEPT通知,可以检测到没有正在进行的AcceptEx操作但存在客户端连接的情况,并可据此触发额外的AcceptEx操作。

1万+

被折叠的 条评论
为什么被折叠?



