s2n_quic_tls_default::ffi

Function s2n_connection_set_recv_cb

source
pub unsafe extern "C" fn s2n_connection_set_recv_cb(
    conn: *mut s2n_connection,
    recv: Option<unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: u32) -> i32>,
) -> i32
Expand description

Configure a connection to use a recv callback to receive data.

@note This callback may be blocking or nonblocking. @note The callback may receive less than the requested length. The function should return the number of bytes received, or set errno and return an error code < 0.

@param conn The connection object being updated @param recv A recv callback function pointer @returns S2N_SUCCESS on success. S2N_FAILURE on failure