Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how cancel a pending ConnectEx?

41 views
Skip to first unread message

lsgt w

unread,
Oct 22, 2009, 9:27:09 AM10/22/09
to
I had try to use closesocket to a pending ConnectEx socket,i hope to
cancel the IO request immeditely.but it seems strange: if closesocket
is not called in the thread which post ConnectEx,the GQCS not returned
immediately,just like the closesocket did not called.It still remain
about 20s and return error 121.

if a shutdown and closesocket all be called in the same thread which
post ConnectEx,sometimes it work,sometimes it did not work.if post
many (about 50) ConnectEx to a not exist address,and after some time
(below 20s) call closesocket for each socket,we can see some socket
return by GQCS,some does not.even sometimes no one can return.

I don't know what happend.how can i cancel a pending ConnectEx?

At last,i try CancelIo,and make this call is in the same thread whicj
post ConnectEx,it seems work.after CancelIo called,the socket is auto
changed to INVALID_SOCKET. Can someone told me,can i use CancelIo at
here? and after CancelIo,is the resource associated with the socket is
cleared?

What is the CORRECT mothod to cancel a pending ConnectEx with IOCP?

0 new messages