1iob_send(3)                Library Functions Manual                iob_send(3)
2
3
4

NAME

6       iob_send - send I/O batch
7

SYNTAX

9       #include <iob.h>
10
11       int64 iob_send(int64 s,io_batch* b);
12

DESCRIPTION

14       iob_send sends the (rest of) b over the socket s.
15
16       iob_send  returns  the number of bytes written, 0 if there were no more
17       bytes to be written in the batch, -1 for EAGAIN, or -3 for a  permanent
18       error (for example "connection reset by peer").
19
20       The  normal usage pattern is using io_wait to know when a descriptor is
21       writable, and then calling iob_send until it returns 0, -1 or -3.
22
23       If it returns 0, terminate the loop (everything was written OK).  If it
24       returns -1, call io_wait again.  If it returned -3, signal an error and
25       close the socket.
26
27       The benefit of the I/O batch API is that it exploits platform  specific
28       APIs like FreeBSD's sendfile.  The file contents will always be sent in
29       a way that allows the operating systems to perform zero copy  TCP,  and
30       the  buffers  will always be sent using as few syscalls as possible and
31       avoiding unnecessary copying (using writev).
32

SEE ALSO

34       iob_reset(3),     iob_send(3),     iob_addbuf(3),     iob_adds_free(3),
35       iob_addfile(3), iob_prefetch(3)
36
37
38
39                                                                   iob_send(3)
Impressum