Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
783 B

  1. .TH io_getcookie 3
  2. .SH NAME
  3. io_getcookie \- retrieve cookie
  4. .SH SYNTAX
  5. .B #include <libowfat/io.h>
  6. void* \fBio_getcookie\fP(int64 fd);
  7. .SH DESCRIPTION
  8. io_getcookie retrieves a cookie (pointer to some anonymous data
  9. structure you associated with this descriptor).
  10. Use io_setcookie(3) to associate a cookie with a descriptor.
  11. If you did not associate a cookie with this descriptor, io_getcookie
  12. returns NULL.
  13. The idea is that you put the state associated with a TCP connection you
  14. serve in a common struct. Then you do not need to have your own data
  15. structure to retrieve the state for a connection, you can just use the
  16. data structure io_wait already maintains. The lookup works in constant
  17. time and should not cause any cache misses.
  18. .SH "SEE ALSO"
  19. io_wait(3), io_setcookie(3)