Skip to main content

ddsrt_socket

Function ddsrt_socket 

Source
pub unsafe extern "C" fn ddsrt_socket(
    sockptr: *mut ddsrt_socket_t,
    domain: c_int,
    type_: c_int,
    protocol: c_int,
) -> dds_return_t
Expand description

@brief Creates a socket

@param[out] sockptr a pointer to the socket (file descriptor) created @param[in] domain the communication domain, selects the protocol family e.g. PF_INET, PF_PACKET @param[in] type specifies communication semantics e.g. SOCK_STREAM, SOCK_RAW @param[in] protocol specifies a particular protocol to be used with the socket e.g. IPPROTO_TCP, IPPROTO_UDP. 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 0. @return a DDS_RETCODE (OK, ERROR, NOT_ALLOWED, BAD_PARAMETER, OUT_OF_RESOURCES)

See @ddsrt_bind, @ddsrt_close