Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
curl_multi_socket_action(3) | libcurl Manual | curl_multi_socket_action(3) |
NAME
curl_multi_socket_action - reads/writes available data given an actionSYNOPSIS
#include <curl/curl.h>
CURLMcode curl_multi_socket_action(CURLM *multi_handle,
curl_socket_t sockfd,
int ev_bitmask,
int *running_handles);
DESCRIPTION
When the application has detected action on a socket handled by libcurl, it should call curl_multi_socket_action(3) with the sockfd argument set to the socket with the action. When the events on a socket are known, they can be passed as an events bitmask ev_bitmask by first setting ev_bitmask to 0, and then adding using bitwise OR (|) any combination of events to be chosen from CURL_CSELECT_IN, CURL_CSELECT_OUT or CURL_CSELECT_ERR. When the events on a socket are unknown, pass 0 instead, and libcurl will test the descriptor internally. It is also permissible to pass CURL_SOCKET_TIMEOUT to the sockfd parameter in order to initiate the whole process or when a timeout occurs.TYPICAL USAGE
1. Create a multi handleEXAMPLE
/* the event-library gets told when there activity on the socket 'fd',
which we translate to a call to curl_multi_socket_action() */
int running;
rc = curl_multi_socket_action(multi_handle, fd, EVENT,
&running);
AVAILABILITY
This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0.RETURN VALUE
CURLMcode type, general libcurl multi interface error code. See libcurl-errors(3)SEE ALSO
curl_multi_cleanup(3), curl_multi_init(3), curl_multi_fdset(3), curl_multi_info_read(3), the hiperfifo.c exampleMay 17, 2022 | libcurl 7.84.0 |