Skip to main content

nros_platform_tcp_send

Function nros_platform_tcp_send 

Source
pub unsafe extern "C" fn nros_platform_tcp_send(
    sock: *const c_void,
    buf: *const u8,
    len: usize,
) -> usize
Expand description

Send up to len bytes, waiting at most about the socket’s timeout (the timeout_ms it was opened with) for the stack to take them. Returns the bytes taken, which may be fewer than len and is 0 when the stack took none in that time, or NROS_PLATFORM_NET_SOCKET_ERROR when the connection is broken. It never waits for a peer that has stopped reading: a caller that needs every byte loops, and decides how long a stall it tolerates (zenoh-pico: Z_TRANSPORT_TX_WAIT_BEFORE_CLOSE). A socket opened with timeout_ms == 0 states no bound.