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

How to get FD_CLOSE for listener socket?

15 views
Skip to first unread message

Michael Bruschkewitz

unread,
Sep 15, 2010, 5:25:26 AM9/15/10
to
Hello,
there is a problem concerning the example for the WSAEnumNetworkEvents
function in Visual Studio 2008.

...
// Associate event types FD_ACCEPT and FD_CLOSE
// with the listening socket and NewEvent
WSAEventSelect(ListenSocket, NewEvent, FD_ACCEPT|FD_CLOSE);
...
Index = WSAWaitForMultipleEvents(1, &EventArray[i], TRUE, 1000, FALSE);
...
WSAEnumNetworkEvents(SocketArray[i],EventArray[i],&NetworkEvents);
...

But I never get a FD_CLOSE-event for the listener socket.

Docu states that closesocket doesn't cause a FD_CLOSE event.
How do I trigger a FD_CLOSE event locally?

(If it's not possible to trigger a FD_CLOSE-event this value should be
removed from WSAEventSelect-call!)

Regards,
Michael B.

0 new messages