curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Send data before receiving data using the callback approach for WebSocket requests

From: Daniel Stenberg via curl-library <>
Date: Wed, 7 Jun 2023 08:17:15 +0200 (CEST)

On Mon, 5 Jun 2023, Darshan Sen via curl-library wrote:

> Actually, I would still need this to work with the callback approach
> because my application is required to work in a push-based mechanism, so
> that it can allow users to attach callbacks to listen for received data
> instead of a pull-based model where users would need to explicitly call my
> APIs to pull in the received data. To be clear, I'm basically creating a
> libcurl-based Node.js C++ addon <> for
> the WebSocket JavaScript Web API
> <> where users
> should be able to attach callback handlers to process the received data and
> explicitly call my APIs to send data.

Right now, the callback approach only sends incoming data to the write
callback so there is no way to first send data or to use the read callback.

I'm open for discussing how we can improve this so maybe we can come up with a
way for this that can be made to work in a future?

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2023-06-07