riot_sys

Function gnrc_tcp_accept

Source
pub unsafe extern "C" fn gnrc_tcp_accept(
    queue: *mut gnrc_tcp_tcb_queue_t,
    tcb: *mut *mut gnrc_tcp_tcb_t,
    user_timeout_duration_ms: u32,
) -> c_int
Expand description

@brief Accept TCP connection from listening queue.

@pre @p queue must not be NULL @pre @p tcb must not be NULL

@note Function blocks if user_timeout_duration_us is not zero.

@param[in] queue Listening queue to accept connection from. @param[out] tcb Pointer to TCB associated with a established connection. @param[in] user_timeout_duration_ms User specified timeout in milliseconds. If GNRC_TCP_NO_TIMEOUT the function blocks until a connection was established or an error occurred.

@return 0 on success. @return -ENOMEM if all connection in @p queue were already accepted. @return -EINVAL if listen was never called on queue. @return -EAGAIN if @p user_timeout_duration_ms was 0 and no connection is ready to accept. @return -ETIMEDOUT if @p user_timeout_duration_ms was not 0 and no connection could be established.