MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / connect

Function connect

src/net/socket.rs:159–161  ·  view source on GitHub ↗

`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)

Source from the content-addressed store, hash-verified

157/// [glibc]: https://sourceware.org/glibc/manual/latest/html_node/Connecting.html
158/// [`Errno::WOULDBLOCK`]: io::Errno::WOULDBLOCK
159pub 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.

Callers 15

test_socketopts_ip_mtuFunction · 0.50
test_socketopts_ipv6_mtuFunction · 0.50
clientFunction · 0.50
do_test_unix_msgFunction · 0.50
test_unix_msg_with_comboFunction · 0.50
net_dgram_v4_connect_anyFunction · 0.50
net_dgram_v6_connect_anyFunction · 0.50
net_dgram_v4_connectFunction · 0.50
net_dgram_v6_connectFunction · 0.50

Calls 1

as_fdMethod · 0.45