mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
handle HOSTUNREACH for blocking and non-blocking connects
This commit is contained in:
parent
1653a9b259
commit
a455927150
1 changed files with 2 additions and 0 deletions
|
|
@ -3966,6 +3966,7 @@ pub fn connect(sock: socket_t, sock_addr: *const sockaddr, len: socklen_t) Conne
|
|||
.FAULT => unreachable, // The socket structure address is outside the user's address space.
|
||||
.INTR => continue,
|
||||
.ISCONN => unreachable, // The socket is already connected.
|
||||
.HOSTUNREACH => return error.NetworkUnreachable,
|
||||
.NETUNREACH => return error.NetworkUnreachable,
|
||||
.NOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
|
||||
.PROTOTYPE => unreachable, // The socket type does not support the requested communications protocol.
|
||||
|
|
@ -3995,6 +3996,7 @@ pub fn getsockoptError(sockfd: fd_t) ConnectError!void {
|
|||
.CONNREFUSED => return error.ConnectionRefused,
|
||||
.FAULT => unreachable, // The socket structure address is outside the user's address space.
|
||||
.ISCONN => unreachable, // The socket is already connected.
|
||||
.HOSTUNREACH => return error.NetworkUnreachable,
|
||||
.NETUNREACH => return error.NetworkUnreachable,
|
||||
.NOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
|
||||
.PROTOTYPE => unreachable, // The socket type does not support the requested communications protocol.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue