Function s2n_tls_sys::s2n_send
source · pub unsafe extern "C" fn s2n_send(
conn: *mut s2n_connection,
buf: *const c_void,
size: isize,
blocked: *mut Type
) -> isize
Expand description
Writes and encrypts size
of buf
data to the associated connection. s2n_send() will return the number of bytes
written, and may indicate a partial write.
@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_send() should not duplicate the original parameters, but should
update buf
and size
per the indication of size written.
See the following example for guidance on calling s2n_send()
:
https://github.com/aws/s2n-tls/blob/main/docs/examples/s2n_send.c
@param conn A pointer to the s2n_connection object
@param buf A pointer to a buffer that s2n will write data from
@param size The size of buf
@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.