Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
curl_multi_socket_action(3) | Library Functions Manual | curl_multi_socket_action(3) |
NAME
curl_multi_socket_action - read/write 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 tests 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 handlePROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
/* 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;
CURLM *multi; /* the stack we work with */
int fd; /* the descriptor that had action */
int bitmask; /* what activity that happened */
CURLMcode mc = curl_multi_socket_action(multi, fd, bitmask, &running);
if(mc)
printf("error: %s\n", curl_multi_strerror(mc));
}
AVAILABILITY
Added in curl 7.15.4RETURN VALUE
CURLMcode type, general libcurl multi interface error code. See libcurl-errors(3)SEE ALSO
curl_multi_cleanup(3), curl_multi_fdset(3), curl_multi_info_read(3), curl_multi_init(3), thehiperfifo.cexample2024-11-23 | libcurl |