quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

ares_set_socket_callback.3 (1125B)


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