GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
iob_new_autofree(3) FreeBSD Library Functions Manual iob_new_autofree(3)

iob_new_autofree - create new I/O batch with autofree flag set

#include <libowfat/iob.h>

io_batch* iob_new_autofree(size_t hint_entries);

iob_new_autofree creates a new I/O batch with enough space allocated for hint_entries entries (buffers or files). This is purely a performance hint. If you are unsure just pass 1.

The autofree flag will be set, which means resources will be freed in iob_send once they have been sent out, not only once you call iob_reset or iob_free at the end. You still have to call those as autofree only frees resources to be sent in the batch, not the resources of the batch itself.

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_new_autofree returns a pointer to an I/O batch data structure. If there was a memory allocation error, it returns NULL instead.

iob_new(3), iob_init(3), iob_reset(3), iob_send(3), iob_addbuf(3), iob_adds_free(3), iob_addfile(3)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.