NULL, NULL, &flags, udpsrc->cancellable, &err);
if (G_UNLIKELY (res < 0)) {
- /* EHOSTUNREACH for a UDP socket means that a packet sent with udpsink
- * generated a "port unreachable" ICMP response. We ignore that and try
- * again. */
- if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE)) {
+ /* G_IO_ERROR_HOST_UNREACHABLE for a UDP socket means that a packet sent
+ * with udpsink generated a "port unreachable" ICMP response. We ignore
+ * that and try again.
+ * On Windows we get G_IO_ERROR_CONNECTION_CLOSED instead */
+ if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE) ||
+ g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED)) {
g_clear_error (&err);
goto retry;
}