Skip to main content

ddsrt_bind

Function ddsrt_bind 

Source
pub unsafe extern "C" fn ddsrt_bind(
    sock: ddsrt_socket_t,
    addr: *const sockaddr,
    addrlen: socklen_t,
) -> dds_return_t
Expand description

@brief Assign an address to the socket.

When a socket is created with @ref ddsrt_socket, it exists in a name space (address family) but has no address assigned to it. @ref ddsrt_bind assigns the address specified by ‘addr’ to the socket referred to by the file descriptor ‘sock’.

@param[in,out] sock the socket @param[in] addr address to assign to the socket @param[in] addrlen specifies the size, in bytes, of the address structure pointed to by ‘addr’ @return a DDS_RETCODE (OK, ERROR, NOT_ALLOWED, PRECONDITION_NOT_MET, BAD_PARAMETER)