`bind(sockfd, addr)`—Binds a socket to an IP address. # References - [Beej's Guide to Network Programming] - [POSIX] - [Linux] - [Apple] - [Winsock] - [FreeBSD] - [NetBSD] - [OpenBSD] - [DragonFly BSD] - [illumos] - [glibc] [Beej's Guide to Network Programming]: https://beej.us/guide/bgnet/html/split/system-calls-or-bust.html#bind [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functio
(sockfd: Fd, addr: &impl SocketAddrArg)
| 122 | /// [illumos]: https://illumos.org/man/3SOCKET/bind |
| 123 | /// [glibc]: https://sourceware.org/glibc/manual/latest/html_node/Setting-Address.html |
| 124 | pub fn bind<Fd: AsFd>(sockfd: Fd, addr: &impl SocketAddrArg) -> io::Result<()> { |
| 125 | backend::net::syscalls::bind(sockfd.as_fd(), addr) |
| 126 | } |
| 127 | |
| 128 | /// `connect(sockfd, addr)`—Initiates a connection to an IP address. |
| 129 | /// |