Same behavior under windows. Caused me a lot of grief recently (in a different application). You can actually turn that off (windows) using an (undocumented) socket ioctl _WSAIOW(IOC_VENDOR, 12). However, it's probably best to ignore that message. Windows has this problem (w/o the aforementioned ioctl) even for sockets that are not 'connected' and the socket call (even if it's a 'receive from anywhere') that follows the send operation which caused the ICMP message fails.
I.e., the sequence
sd = socket();
bind(sd);
sendto(sd, data, n, 0, nonexisting_dest, sizeof(nonexisting_dest))
status = recvfrom(sd, ...)
fails in **recvfrom** due to the ICMP message that resulted from the earlier sendto!
Same behavior under windows. Caused me a lot of grief recently (in a different application). You can actually turn that off (windows) using an (undocumented) socket ioctl _WSAIOW(IOC_VENDOR, 12). However, it's probably best to ignore that message. Windows has this problem (w/o the aforementioned ioctl) even for sockets that are not 'connected' and the socket call (even if it's a 'receive from anywhere') that follows the send operation which caused the ICMP message fails.
I.e., the sequence
sd = socket(); nonexisting_ dest))
bind(sd);
sendto(sd, data, n, 0, nonexisting_dest, sizeof(
status = recvfrom(sd, ...)
fails in **recvfrom** due to the ICMP message that resulted from the earlier sendto!