authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-08 10:46:39-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-08 22:58:22+02:00
log5ccfeb9268a5cb42efc7cd3350ae73bd960eafc3
treed50a65dd78a3c001b76a10f6a9e1797939e4080c
parent4bdbcfe95b8f1c1575d045b18225ba743000f956

std.Io.net: add error.PortUnreachable to NetReceive

closes #31787

2 files changed, 8 insertions(+), 0 deletions(-)

lib/std/Io.zig+7
......@@ -374,6 +374,13 @@ pub const Operation = union(enum) {
374374 ConnectionResetByPeer,
375375 /// The local network interface used to reach the destination is offline.
376376 NetworkDown,
377 /// A connectionless packet was previously sent successfully,
378 /// however, it was not received because no service is operating at
379 /// the destination port of the transport on the remote system.
380 /// This caused an ICMP port unreachable packet to be returned to
381 /// the OS where it was queued up to be reported at the next call
382 /// to send or receive on the bound socket.
383 PortUnreachable,
377384 } || Io.UnexpectedError;
378385
379386 pub const Result = struct { ?net.Socket.ReceiveError, usize };
lib/std/Io/Threaded.zig+1
......@@ -13017,6 +13017,7 @@ fn netReceiveOneWindows(
1301713017 .CANCELLED => unreachable,
1301813018 .INSUFFICIENT_RESOURCES => return error.SystemResources,
1301913019 .BUFFER_OVERFLOW => return error.MessageOversize,
13020 .PORT_UNREACHABLE => return error.PortUnreachable,
1302013021 else => |status| return windows.unexpectedStatus(status),
1302113022 }
1302213023}