Module nix::sys::socket
#[cfg(not(target_os = "redox"))]
Documentation
Socket interface functions
Modules
Socket options as used by setsockopt
and getsockopt
.
Structs
Request for multicast socket operations
Request for ipv6 multicast socket operations
Hardware Address
Flags for send/recv and their relatives
RecvMmsgData any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "netbsd",)
SendMmsgData any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "netbsd",)
Additional socket options
A wrapper around sockaddr_un
.
Unix credentials of the sending process.
Enums
These constants specify the protocol family to be used
in socket
and socketpair
A type-safe zero-copy wrapper around a single control message, as used wih
sendmsg
. More types may be added to this enum; do not
exhaustively pattern-match it.
A type-safe wrapper around a single control message, as used with
recvmsg
.
Represents a socket address
Constants used in socket
and socketpair
to specify the protocol to use.
These constants are used to specify the communication semantics
when creating a socket with socket()
Functions
Accept a connection on a socket
accept4 any(all(target_os = "android", any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")), target_os = "freebsd", target_os = "linux", target_os = "openbsd")
Accept a connection on a socket
Bind a name to a socket
Initiate a connection on a socket
Get the address of the peer connected to the socket fd
.
Get the current address to which the socket fd
is bound.
Get the current value for the requested socket option
Listen for connections on a socket
Receive data from a connection-oriented socket. Returns the number of bytes read
Receive data from a connectionless or connection-oriented socket. Returns the number of bytes read and, for connectionless sockets, the socket address of the sender.
recvmmsg any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "netbsd",)
An extension of recvmsg
that allows the caller to receive multiple
messages from a socket using a single system call. This has
performance benefits for some applications.
Receive message in scatter-gather vectors from a socket, and optionally receive ancillary data into the provided buffer. If no ancillary data is desired, use () as the type parameter.
Send data to a connection-oriented socket. Returns the number of bytes read
sendmmsg any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "netbsd",)
An extension of sendmsg
that allows the caller to transmit multiple
messages on a socket using a single system call. This has performance
benefits for some applications.
Send data in scatter-gather vectors to a socket, possibly accompanied by ancillary data. Optionally direct the message at the given address, as with sendto.
Send a message to a socket
Sets the value for the requested socket option
Shut down part of a full-duplex connection.
Return the appropriate SockAddr
type from a sockaddr_storage
of a
certain size.
Create an endpoint for communication
Create a pair of connected sockets
Traits
Represents a socket option that can be retrieved.
Represents a socket option that can be set.