让 lpfnAcceptEx (accpetex) 在本机 C++ 中阻塞;
我一直在尝试让 Win32 中的 lpfnAcceptEX 函数阻止接受。如果这是不可能的,我想知道是否有一个我可以接受的标志或我可以等待的其他功能。现在,程序只是不断地创建接受的套接字,背后没有连接。
也许我误解了这是如何运作的。还有其他功能需要等待吗?
我正在遵循此处列出的示例: http:// msdn.microsoft.com/en-us/library/ms737524(VS.85).aspx
谢谢, =阿利卡尔
I've been trying to get the lpfnAcceptEX function in Win32 to block on accept. If this is not possible I was wondering if there was a flag I could accpet or some other function that I could wait on. Right now the program is simply continually creating accepted sockets with no connections behind them.
Perhaps I am misunderstanding how this is to work. Is there another function I need to wait on?
I am following the example laid out here: http://msdn.microsoft.com/en-us/library/ms737524(VS.85).aspx
Thanks,
= Alikar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您传入了有效的
OVERLAPPED
结构并且未使用 I/O 完成端口,只需调用WaitForSingleObject(overlapped.hEvent, TRUE)
即可阻止AcceptEx
。Assuming you passed in a valid
OVERLAPPED
structure and aren't using I/O completion ports, just callWaitForSingleObject(overlapped.hEvent, TRUE)
to block onAcceptEx
.