Replies: 1 comment
-
It sounds like the answer is no, but in general, feature requests should be opened as issues not discussions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
On Windows, after a UdpSocket is bound to a local endpoint, when we call
send_to
against a remote endpoint which replies an ICMP unreachable message, we will get an error on subsequent calls torecv_from
on the socket. Instead, the async call tosend_to
will succeed. Thestd::io::Error
contains OS Error 10054: Connection Reset. This is somewhat expected behavior for WinSock according to https://stackoverflow.com/questions/34242622/windows-udp-sockets-recvfrom-fails-with-error-10054 .My question is that, is it possible for tokio to provide some mechanism to associate the error with the failing remote endpoint? As far as I investigated, Windows has no native methods to achieve that (some considered this a 'bug' of Windows), but still, it would be a nice to have for P2P applications where we can file rejecting endpoints and stop retrying to communicate wieh them.
Edit: After thinking further, this maybe not possible without behavior changes from Windows side. Suppose two UDP datagrams are sent, and the first got an ICMP port unreachable message but only after the second datagram is fully sent. The application have no actual way to know the failing endpoint from the 10054 OS error without the endpoint information attached to it 🤔
Beta Was this translation helpful? Give feedback.
All reactions