Monday, 15 February 2010

sockets - Winsock: DisconnectEx with IO Completion port -



sockets - Winsock: DisconnectEx with IO Completion port -

i expecting notification using getqueuedcompletionstatus after scheduling overlapped disconnect disconnectex. never 1 - design? if specify manual reset event in overlapped construction signalled indicate disconnect complete, getqueuedcompletionstatus never returns.

my phone call disconnectex looks bit (note context has operator lpoverlapped , ol first element in structure):

context.ol.hevent = hevent; bool result = disconnectex(context.socket, context, tf_reuse_socket, 0); if (result) { // completed synchronously: processcompletion(0, context, 0); } else { int error = wsagetlasterror(); if (error != error_io_pending) { throw serversocketexception("disconnectex failed"); } waitforsingleobject(hevent, infinite); std::cout << "disconnected - event signalled\n"; }

i added waitforsingleobject when found getqueuedcompletionstatus didn't return. right way observe disconnectex completing? want utilize socket 1 time again in phone call acceptex.

thanks

a.

sockets winsock winsock2 io-completion-ports

No comments:

Post a Comment