`connect(sockfd, addr)`—Initiates a connection to an IP address. On Windows, a non-blocking socket returns [`Errno::WOULDBLOCK`] if the connection cannot be completed immediately, rather than `Errno::INPROGRESS`. # References - [Beej's Guide to Network Programming] - [POSIX] - [Linux] - [Apple] - [Winsock] - [FreeBSD] - [NetBSD] - [OpenBSD] - [DragonFly BSD] - [illumos] - [glibc] [Beej's Guide
(sockfd: Fd, addr: &impl SocketAddrArg)
| 157 | /// [glibc]: https://sourceware.org/glibc/manual/latest/html_node/Connecting.html |
| 158 | /// [`Errno::WOULDBLOCK`]: io::Errno::WOULDBLOCK |
| 159 | pub fn connect<Fd: AsFd>(sockfd: Fd, addr: &impl SocketAddrArg) -> io::Result<()> { |
| 160 | backend::net::syscalls::connect(sockfd.as_fd(), addr) |
| 161 | } |
| 162 | |
| 163 | /// `connect(sockfd, {.sa_family = AF_UNSPEC}, sizeof(struct sockaddr))`— |
| 164 | /// Dissolve the socket's association. |