riot_sys::bindgen

Function sock_tcp_write

Source
pub unsafe extern "C" fn sock_tcp_write(
    sock: *mut sock_tcp_t,
    data: *const c_void,
    len: size_t,
) -> ssize_t
Expand description

@brief Writes data to an established TCP stream

@pre (sock != NULL) @pre if (len != NULL): (data != NULL)

@param[in] sock A TCP sock object. @param[in] data Pointer to the data to be written to the stream. @param[in] len Maximum space available at @p data.

@note Function may block.

@return The number of bytes written on success. @return -ECONNABORTED, if the connection is aborted while waiting for the next data. @return -ECONNRESET, if the connection was forcibly closed by remote end point of @p sock. @return -ENOMEM, if no memory was available to written @p data. @return -ENOTCONN, if @p sock is not connected to a remote end point.