authorgravatar for ekindursun@gmail.comEkin Dursun <ekindursun@gmail.com> 2024-06-07 14:20:04+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-06-08 15:35:00-04:00
log0ba64e9ce3afcc400b55f7349c838e2d00e3c00d
tree9b04c00b0d6d8c67daeb6ed0208177a20704a545
parent2cd536d7e8ae9c095eace969561a5e23c332fdad

Add ECONNREFUSED to sendto


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/posix.zig+4
...@@ -5933,6 +5933,8 @@ pub fn sendmsg(...@@ -5933,6 +5933,8 @@ pub fn sendmsg(
5933pub const SendToError = SendMsgError || error{5933pub const SendToError = SendMsgError || error{
5934 /// The destination address is not reachable by the bound address.5934 /// The destination address is not reachable by the bound address.
5935 UnreachableAddress,5935 UnreachableAddress,
5936 /// The destination address is not listening.
5937 ConnectionRefused,
5936};5938};
59375939
5938/// Transmit a message to another socket.5940/// Transmit a message to another socket.
...@@ -6005,6 +6007,7 @@ pub fn sendto(...@@ -6005,6 +6007,7 @@ pub fn sendto(
6005 .AGAIN => return error.WouldBlock,6007 .AGAIN => return error.WouldBlock,
6006 .ALREADY => return error.FastOpenAlreadyInProgress,6008 .ALREADY => return error.FastOpenAlreadyInProgress,
6007 .BADF => unreachable, // always a race condition6009 .BADF => unreachable, // always a race condition
6010 .CONNREFUSED => return error.ConnectionRefused,
6008 .CONNRESET => return error.ConnectionResetByPeer,6011 .CONNRESET => return error.ConnectionResetByPeer,
6009 .DESTADDRREQ => unreachable, // The socket is not connection-mode, and no peer address is set.6012 .DESTADDRREQ => unreachable, // The socket is not connection-mode, and no peer address is set.
6010 .FAULT => unreachable, // An invalid user space address was specified for an argument.6013 .FAULT => unreachable, // An invalid user space address was specified for an argument.
...@@ -6066,6 +6069,7 @@ pub fn send(...@@ -6066,6 +6069,7 @@ pub fn send(
6066 error.AddressNotAvailable => unreachable,6069 error.AddressNotAvailable => unreachable,
6067 error.SocketNotConnected => unreachable,6070 error.SocketNotConnected => unreachable,
6068 error.UnreachableAddress => unreachable,6071 error.UnreachableAddress => unreachable,
6072 error.ConnectionRefused => unreachable,
6069 else => |e| return e,6073 else => |e| return e,
6070 };6074 };
6071}6075}