Function scratchstack_wrapper_aws_c_io::aws_socket_write
source · pub unsafe extern "C" fn aws_socket_write(
socket: *mut aws_socket,
cursor: *const aws_byte_cursor,
written_fn: aws_socket_on_write_completed_fn,
user_data: *mut c_void
) -> c_int
Expand description
Writes to the socket. This call is non-blocking and will attempt to write as much as it can, but will queue any remaining portion of the data for write when available. written_fn will be invoked once the entire cursor has been written, or the write failed or was cancelled.
NOTE! This function must be called from the event-loop used in aws_socket_assign_to_event_loop
For client sockets, connect() and aws_socket_assign_to_event_loop() must be called before calling this.
For incoming sockets from a listener, aws_socket_assign_to_event_loop() must be called first.