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

Function socket

src/net/socket.rs:45–51  ·  view source on GitHub ↗
(
    domain: AddressFamily,
    type_: SocketType,
    protocol: Option<Protocol>,
)

Source from the content-addressed store, hash-verified

43/// [glibc]: https://sourceware.org/glibc/manual/latest/html_node/Creating-a-Socket.html
44#[inline]
45pub fn socket(
46 domain: AddressFamily,
47 type_: SocketType,
48 protocol: Option<Protocol>,
49) -> io::Result<OwnedFd> {
50 backend::net::syscalls::socket(domain, type_, protocol)
51}
52
53/// `socket_with(domain, type_ | flags, protocol)`—Creates a socket, with
54/// flags.

Callers 15

test_sockopts_ipv4Function · 0.50
test_sockopts_ipv6Function · 0.50
test_socket_passcredFunction · 0.50
test_socketopts_ip_mtuFunction · 0.50
test_socketopts_ipv6_mtuFunction · 0.50
test_ip_mtu_discoverFunction · 0.50
test_sockopts_txtimeFunction · 0.50
serverFunction · 0.50
clientFunction · 0.50

Calls

no outgoing calls

Tested by 15

test_sockopts_ipv4Function · 0.40
test_sockopts_ipv6Function · 0.40
test_socket_passcredFunction · 0.40
test_socketopts_ip_mtuFunction · 0.40
test_socketopts_ipv6_mtuFunction · 0.40
test_ip_mtu_discoverFunction · 0.40
test_sockopts_txtimeFunction · 0.40
test_unix_msg_with_comboFunction · 0.40