Getting lpfnAcceptEx (accpetex) to block in native C++
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
Assuming you passed in a valid OVERLAPPED
structure and aren't using I/O completion ports, just call WaitForSingleObject(overlapped.hEvent, TRUE)
to block on AcceptEx
.
精彩评论