Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1019 B

.TH iob_write 3
iob_write \- send I/O batch through callback
.B #include <iob.h>
int64 \fBiob_write\fR(int64 s,io_batch* b,io_write_callback cb);
iob_write sends the (rest of) \fIb\fR through the callback \fIcb\fR,
passing \fIs\fR as first argument. \fIcb\fR is expected to behave like
This interface is intended to send an I/O batch through a filter, for
example to encrypt or compress it. If you just want to send an I/O
batch to a socket, use iob_send instead.
iob_write returns the number of bytes written, 0 if there were no more
bytes to be written in the batch, -1 for EAGAIN, or -3 for a permanent
error (for example "connection reset by peer").
The normal usage pattern is using io_wait to know when a descriptor is
writable, and then calling iob_write until it returns 0, -1 or -3.
If it returns 0, terminate the loop (everything was written OK). If it
returns -1, call io_wait again. If it returned -3, signal an error.