Function nix::sys::socket::socket

source ยท
pub fn socket<T: Into<Option<SockProtocol>>>(
    domain: AddressFamily,
    ty: SockType,
    flags: SockFlag,
    protocol: T,
) -> Result<RawFd>
Expand description

Create an endpoint for communication

The protocol specifies a particular protocol to be used with the socket. Normally only a single protocol exists to support a particular socket type within a given protocol family, in which case protocol can be specified as None. However, it is possible that many protocols may exist, in which case a particular protocol must be specified in this manner.

Further reading