ares_set_socket_callback.3 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. .\"
  2. .TH ARES_SET_SOCKET_CALLBACK 3 "20 Nov 2009"
  3. .SH NAME
  4. ares_set_socket_callback \- Set a socket creation callback
  5. .SH SYNOPSIS
  6. .nf
  7. .B #include <ares.h>
  8. .PP
  9. .B typedef int (*ares_sock_create_callback)(ares_socket_t \fIsocket_fd\fP,
  10. int \fItype\fP,
  11. void *\fIuserdata\fP)
  12. .PP
  13. .B void ares_set_socket_callback(ares_channel \fIchannel\fP,
  14. ares_sock_create_callback \fIcallback\fP,
  15. void *\fIuserdata\fP)
  16. .PP
  17. .B cc file.c -lcares
  18. .fi
  19. .SH DESCRIPTION
  20. .PP
  21. This function sets a \fIcallback\fP in the given ares channel handle. This
  22. callback function will be invoked after the socket has been created, and
  23. connected to the remote server. The callback must return ARES_SUCCESS if
  24. things are fine, or return -1 to signal an error. A returned error will
  25. abort the ares operation.
  26. .SH SEE ALSO
  27. .BR ares_init_options (3), ares_set_socket_configure_callback (3)
  28. .SH AVAILABILITY
  29. ares_set_socket_callback(3) was added in c-ares 1.6.0
  30. .SH AUTHOR
  31. Gregor Jasny