1io_getcookie(3) Library Functions Manual io_getcookie(3)
2
3
4
6 io_getcookie - retrieve cookie
7
9 #include <io.h>
10
11 void* io_getcookie(int64 fd);
12
14 io_getcookie retrieves a cookie (pointer to some anonymous data strucā
15 ture you associated with this descriptor).
16
17 Use io_setcookie(3) to associate a cookie with a descriptor.
18
19 If you did not associate a cookie with this descriptor, io_getcookie
20 returns NULL.
21
22 The idea is that you put the state associated with a TCP connection you
23 serve in a common struct. Then you do not need to have your own data
24 structure to retrieve the state for a connection, you can just use the
25 data structure io_wait already maintains. The lookup works in constant
26 time and should not cause any cache misses.
27
29 io_wait(3), io_setcookie(3)
30
31
32
33 io_getcookie(3)