riot_sys

Function gnrc_tcp_send

Source
pub unsafe extern "C" fn gnrc_tcp_send(
    tcb: *mut gnrc_tcp_tcb_t,
    data: *const c_void,
    len: size_t,
    user_timeout_duration_ms: u32,
) -> ssize_t
Expand description

@brief Transmit data to connected peer.

@pre gnrc_tcp_tcb_init() must have been successfully called. @pre @p tcb must not be NULL. @pre @p data must not be NULL.

@note Blocks until up to @p len bytes were transmitted or an error occurred.

@param[in,out] tcb TCB holding the connection information. @param[in] data Pointer to the data that should be transmitted. @param[in] len Number of bytes that should be transmitted. @param[in] user_timeout_duration_ms If not zero and there was not data transmitted the function returns after user_timeout_duration_ms. If zero, no timeout will be triggered. If GNRC_TCP_NO_TIMEOUT the timeout is disabled causing the function to block until some data was transmitted or and error occurred.

@return The number of successfully transmitted bytes. @return -ENOTCONN if connection is not established. @return -ECONNRESET if connection was reset by the peer. @return -ECONNABORTED if the connection was aborted. @return -ETIMEDOUT if @p user_timeout_duration_ms expired.