curl_ws_send(3) | libcurl Manual | curl_ws_send(3) |
curl_ws_send - send WebSocket data
#include <curl/easy.h> CURLcode curl_ws_send(CURL *curl, const void *buffer, size_t buflen,
size_t *sent, curl_off_t fragsize,
unsigned int flags);
This function call is EXPERIMENTAL.
Send the specific message fragment over an established WebSocket connection. The buffer holds the data to send and it is buflen number of payload bytes in that memory area.
sent is returned as the number of payload bytes actually sent.
To send a (huge) fragment using multiple calls with partial content per invoke, set the CURLWS_OFFSET bit and the fragsize argument as the total expected size for the first part, then set the CURLWS_OFFSET with a zero fragsize for the following parts.
If not sending a partial fragment or if this is raw mode, fragsize should be set to zero.
If CURLWS_RAW_MODE is enabled in CURLOPT_WS_OPTIONS(3), the flags argument should be set to 0.
To send a message consisting of multiple frames, set the CURLWS_CONT bit in all frames except the final one.
Added in 7.86.0.
curl_easy_setopt(3), curl_easy_perform(3), curl_easy_getinfo(3), curl_ws_recv(3)
February 6, 2023 | libcurl 7.88.1 |