Discussion:
Not getting WSAECONNRESET when calling sendto on unavailable port
(too old to reply)
a***@gmail.com
2011-10-13 20:12:56 UTC
Permalink
Hi,

I have a non-block UDP client socket, I call sendto to send packet to
a remote peer that took the port down. But the sendto always succeeds
with the number of bytes sent, not ICMP port unreachable message
(WSAECONNRESET), from the wireshark, I can see the ICMP port
unreachable message was sent back. But the sendto always succeeds. Any
ideas, TIA.

-Andy
a***@gmail.com
2011-10-13 20:22:20 UTC
Permalink
Post by a***@gmail.com
Hi,
I have a non-block UDP client socket, I call sendto to send packet to
a remote peer that took the port down. But the sendto always succeeds
with the number of bytes sent, not ICMP port unreachable message
(WSAECONNRESET), from the wireshark, I can see the ICMP port
unreachable message was sent back. But the sendto always succeeds. Any
ideas, TIA.
-Andy
BTW, I bind the socket to the local interface.

-Andy
Len Holgate
2011-10-28 08:30:54 UTC
Permalink
Andy,

I've written about this here:
http://www.lenholgate.com/blog/2007/12/bug-in-overlapped-udp-port-unreachable-errors.html

short of listening to the icmp messages directly, I dont think there's
a solution.

Len
Post by a***@gmail.com
Post by a***@gmail.com
Hi,
I have a non-block UDP client socket, I call sendto to send packet to
a remote peer that took the port down. But the sendto always succeeds
with the number of bytes sent, not ICMP port unreachable message
(WSAECONNRESET), from the wireshark, I can see the ICMP port
unreachable message was sent back. But the sendto always succeeds. Any
ideas, TIA.
-Andy
BTW, I bind the socket to the local interface.
-Andy
Loading...