Skip to content
Discussion options

You must be logged in to vote

In general, curl_ws_send() can return CURLE_AGAIN on any call. If it does return OK and the amount returned in sent is the amount written, the data in the buffer has either been transmitted or is queue in curl's internal send buffers. The application can then do with its buffer whatever it wants.

As for usage, curl_ws_send() was intended to be used more in a "standalone", single transfer application. Since curl 8.16.0, libcurl supports the CURLOPT_READFUNCTION for sending data on a websocket. I wrote a blog post about this.

Using CURLOPT_READFUNCTION for sending is the recommended way to use websocket in a multi handle. It should give a cleaner application code with no worries about EAGAI…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@SCRIER-org
Comment options

@SCRIER-org
Comment options

@icing
Comment options

icing Oct 13, 2025
Collaborator

@SCRIER-org
Comment options

Answer selected by SCRIER-org
Comment options

You must be logged in to vote
1 reply
@SCRIER-org
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants