tags:

views:

148

answers:

1

I noticed that when I call closesocket, the completion routine of WSARecvFrom (which by that time waits for incoming data) is being triggered with dwError=0 and cbTransferred=garbage, eve though there is no incoming data pending for that socket.

Any way for it not to be called when i close the socket? I tried to call shutdown prior to closesocket, but it didn't help.

A: 

What value does WSARecvFrom() itself return? I have not used WSARecvFrom() myself, but MSDN says dwError is a completion status, so I would imagine that 0 means an actual error, or no data.

Also, are you calling CancelIo() before calling closesocket()?

Remy Lebeau - TeamB