Function riot_sys::sock_tcp_listen

source ·
pub unsafe extern "C" fn sock_tcp_listen(
    queue: *mut sock_tcp_queue_t,
    local: *const sock_tcp_ep_t,
    queue_array: *mut sock_tcp_t,
    queue_len: c_uint,
    flags: u16
) -> c_int
Expand description

@brief Listen for an incoming connection request on @p local end point

@pre queue != NULL @pre (local != NULL) && (local->port != 0) @pre (queue_array != NULL) && (queue_len != 0)

@param[in] queue The resulting listening queue. @param[in] local Local end point to listen on. @param[in] queue_array Array of sock objects. @param[in] queue_len Length of @p queue_array. @param[in] flags Flags for the listening queue. See also @ref net_sock_flags. May be 0.

@return 0 on success. @return -EADDRINUSE, if (flags & SOCK_FLAGS_REUSE_EP) == 0 and @p local is already used elsewhere @return -EAFNOSUPPORT, if sock_tcp_ep_t::family of @p local is not supported. @return -EINVAL, if sock_tcp_ep_t::netif of @p local is not a valid interface. @return -ENOMEM, if no memory was available to listen on @p queue.