From a8acbba46a3161add008d50830740fb0201f560a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 17 Aug 2020 13:11:22 +0300 Subject: [PATCH] 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. --- gio/gioerror.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gio/gioerror.c b/gio/gioerror.c index 1ec120d98..477906c0c 100644 --- a/gio/gioerror.c +++ b/gio/gioerror.c @@ -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;