Function s2n_tls_sys::s2n_sendv_with_offset

source ·
pub unsafe extern "C" fn s2n_sendv_with_offset(
    conn: *mut s2n_connection,
    bufs: *const iovec,
    count: isize,
    offs: isize,
    blocked: *mut Type
) -> isize
Expand description

Works in the same way as s2n_send() except that it accepts vectorized buffers. Will return the number of bytes written, and may indicate a partial write. Partial writes are possible not just for non-blocking I/O, but also for connections aborted while active.

@note Partial writes are possible not just for non-blocking I/O, but also for connections aborted while active.

@note Unlike OpenSSL, repeated calls to s2n_sendv_with_offset() should not duplicate the original parameters, but should update bufs and count per the indication of size written.

See the following example for guidance on calling s2n_sendv_with_offset(): https://github.com/aws/s2n-tls/blob/main/docs/examples/s2n_send.c

@param conn A pointer to the s2n_connection object @param bufs A pointer to a vector of buffers that s2n will write data from. @param count The number of buffers in bufs @param offs The write cursor offset. This should be updated as data is written. See the example code. @param blocked A pointer which will be set to the blocked status if an S2N_ERR_T_BLOCKED error is returned. @returns The number of bytes written on success, which may indicate a partial write. S2N_FAILURE on failure.