Skip to main content

ddsrt_accept

Function ddsrt_accept 

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

@brief Accept a connect (@ref ddsrt_connect) request and create a new connected socket for it.

Is used with connection-based socket types (SOCK_STREAM, SOCK_SEQPACKET).

  • ‘addrlen’ must contain the size of the structure pointed to by ‘addr’ before the operation, and afterwards will contain the the size of the peer address.
  • when not used, ‘addr’ and ‘addrlen’ must be NULL

@param[in,out] sock socket with which to wait for a connection @param[out] addr address of the connecting peer @param[in,out] addrlen the size (in bytes) of the structure pointed to by ‘addr’ @param[out] connptr pointer to the new connected socket. @return a DDS_RETCODE (OK, ERROR, and more)

See @ref ddsrt_bind, ddsrt_listen