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
io_setcookie(3) FreeBSD Library Functions Manual io_setcookie(3)

io_setcookie - associate cookie with descriptor

#include <libowfat/io.h>

void io_setcookie(int64 fd,void* cookie);

io_setcookie associates a cookie (pointer to some anonymous data structure) with this descriptor. Only one cookie can be associated with a descriptor.

Use io_getcookie(3) to retrieve the cookie for a descriptor (usually after io_canread or io_canwrite brought it to your attention).

Please note that io_close does not deallocate your cookie. You need to do that yourself.

The idea is that you put the state associated with a TCP connection you serve in a common struct. Then you do not need to have your own data structure to retrieve the state for a connection, you can just use the data structure io_wait already maintains. The lookup works in constant time and should not cause any cache misses.

io_wait(3), io_getcookie(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.