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 <https://nodejs.org/api/addons.html> for the WebSocket JavaScript Web API <https://developer.mozilla.org/en-US/docs/Web/API/WebSocket> 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?
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html