| ... | ... | @@ -4285,6 +4285,9 @@ pub const ConnectError = error{ |
| 4285 | 4285 | |
| 4286 | 4286 | /// Socket is non-blocking and already has a pending connection in progress. |
| 4287 | 4287 | ConnectionPending, |
| 4288 | |
| 4289 | /// Socket was already connected |
| 4290 | AlreadyConnected, |
| 4288 | 4291 | } || UnexpectedError; |
| 4289 | 4292 | |
| 4290 | 4293 | /// Initiate a connection on a socket. |
| ... | ... | @@ -4305,7 +4308,7 @@ pub fn connect(sock: socket_t, sock_addr: *const sockaddr, len: socklen_t) Conne |
| 4305 | 4308 | => return error.NetworkUnreachable, |
| 4306 | 4309 | .WSAEFAULT => unreachable, |
| 4307 | 4310 | .WSAEINVAL => unreachable, |
| 4308 | | .WSAEISCONN => unreachable, |
| 4311 | .WSAEISCONN => return error.AlreadyConnected, |
| 4309 | 4312 | .WSAENOTSOCK => unreachable, |
| 4310 | 4313 | .WSAEWOULDBLOCK => return error.WouldBlock, |
| 4311 | 4314 | .WSAEACCES => unreachable, |
| ... | ... | @@ -4331,7 +4334,7 @@ pub fn connect(sock: socket_t, sock_addr: *const sockaddr, len: socklen_t) Conne |
| 4331 | 4334 | .CONNRESET => return error.ConnectionResetByPeer, |
| 4332 | 4335 | .FAULT => unreachable, // The socket structure address is outside the user's address space. |
| 4333 | 4336 | .INTR => continue, |
| 4334 | | .ISCONN => unreachable, // The socket is already connected. |
| 4337 | .ISCONN => return error.AlreadyConnected, // The socket is already connected. |
| 4335 | 4338 | .HOSTUNREACH => return error.NetworkUnreachable, |
| 4336 | 4339 | .NETUNREACH => return error.NetworkUnreachable, |
| 4337 | 4340 | .NOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket. |
| ... | ... | @@ -4391,7 +4394,7 @@ pub fn getsockoptError(sockfd: fd_t) ConnectError!void { |
| 4391 | 4394 | .BADF => unreachable, // sockfd is not a valid open file descriptor. |
| 4392 | 4395 | .CONNREFUSED => return error.ConnectionRefused, |
| 4393 | 4396 | .FAULT => unreachable, // The socket structure address is outside the user's address space. |
| 4394 | | .ISCONN => unreachable, // The socket is already connected. |
| 4397 | .ISCONN => return error.AlreadyConnected, // The socket is already connected. |
| 4395 | 4398 | .HOSTUNREACH => return error.NetworkUnreachable, |
| 4396 | 4399 | .NETUNREACH => return error.NetworkUnreachable, |
| 4397 | 4400 | .NOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket. |