| ... | ... | @@ -3254,6 +3254,9 @@ pub const ConnectError = error{ |
| 3254 | 3254 | |
| 3255 | 3255 | /// Connection was reset by peer before connect could complete. |
| 3256 | 3256 | ConnectionResetByPeer, |
| 3257 | |
| 3258 | /// Socket is non-blocking and already has a pending connection in progress. |
| 3259 | ConnectionPending, |
| 3257 | 3260 | } || UnexpectedError; |
| 3258 | 3261 | |
| 3259 | 3262 | /// Initiate a connection on a socket. |
| ... | ... | @@ -3294,7 +3297,7 @@ pub fn connect(sock: socket_t, sock_addr: *const sockaddr, len: socklen_t) Conne |
| 3294 | 3297 | EADDRNOTAVAIL => return error.AddressNotAvailable, |
| 3295 | 3298 | EAFNOSUPPORT => return error.AddressFamilyNotSupported, |
| 3296 | 3299 | EAGAIN, EINPROGRESS => return error.WouldBlock, |
| 3297 | | EALREADY => unreachable, // The socket is nonblocking and a previous connection attempt has not yet been completed. |
| 3300 | EALREADY => return error.ConnectionPending, |
| 3298 | 3301 | EBADF => unreachable, // sockfd is not a valid open file descriptor. |
| 3299 | 3302 | ECONNREFUSED => return error.ConnectionRefused, |
| 3300 | 3303 | ECONNRESET => return error.ConnectionResetByPeer, |
| ... | ... | @@ -3325,7 +3328,7 @@ pub fn getsockoptError(sockfd: fd_t) ConnectError!void { |
| 3325 | 3328 | EADDRNOTAVAIL => return error.AddressNotAvailable, |
| 3326 | 3329 | EAFNOSUPPORT => return error.AddressFamilyNotSupported, |
| 3327 | 3330 | EAGAIN => return error.SystemResources, |
| 3328 | | EALREADY => unreachable, // The socket is nonblocking and a previous connection attempt has not yet been completed. |
| 3331 | EALREADY => return error.ConnectionPending, |
| 3329 | 3332 | EBADF => unreachable, // sockfd is not a valid open file descriptor. |
| 3330 | 3333 | ECONNREFUSED => return error.ConnectionRefused, |
| 3331 | 3334 | EFAULT => unreachable, // The socket structure address is outside the user's address space. |