23 lines
844 B
Raw Normal View History

2004-03-02 20:02:23 +00:00
.TH iob_new 3
iob_new \- create new I/O batch
2004-03-02 22:41:34 +00:00
.B #include <iob.h>
2004-03-02 20:02:23 +00:00
io_batch* \fBiob_new\fP(int hint_entries);
iob_new creates a new I/O batch with enough space allocated for
\fIhint_entries\fR entries (buffers or files). This is purely a
performance hint, if you are unsure just pass 1.
You can add buffers, strings and files to an I/O batch and then send it
all at once using iob_send.
The benefit of the I/O batch API is that it exploits platform specific
APIs like FreeBSD's sendfile. The file contents will always be sent in
a way that allows the operating systems to perform zero copy TCP, and
the buffers will always be sent using as few syscalls as possible and
avoiding unnecessary copying (using writev).
iob_reset(3), iob_send(3), iob_addbuf(3), iob_adds_free(3), iob_addfile(3)