gioerror: Map WSAENETRESET on Windows to G_IO_ERROR_CONNECTION_CLOSED

This has almost the same semantics as WSAECONNRESET and for all
practical purposes is handled the same. The main difference is about
*who* reset the connection: the peer or something in the network.

For UDP sockets this happens when receiving packets and previously sent
packets returned an ICMP "Time(-to-live) expired" message. This is
similar to WSAECONNRESET, which on UDP sockets happens when receiving
packets and previously sent packets returned an ICMP "Port Unreachable"
message.
This commit is contained in:
Sebastian Dröge 2020-08-17 13:11:22 +03:00
parent 7224baffe9
commit a8acbba46a

View File

@ -343,6 +343,7 @@ g_io_error_from_win32_error (gint error_code)
return G_IO_ERROR_NOT_SUPPORTED;
case WSAECONNRESET:
case WSAENETRESET:
case WSAESHUTDOWN:
return G_IO_ERROR_CONNECTION_CLOSED;