The "open" callback covers a bunch of use cases when WS client needs to send something immediately after opening a WebSocket. So, when this callback is called, the WebSocket should be opened successfully and fully operational, so it can send WS messages.
Practical use cases depend on WS applications, and their proprietary WS-message based communication protocols. One example that I know is some WS client app communicating to a remote WS application controlling a web camera. After opening a WebSocket, it sends some command requesting to send back a camera status. A good test use case to test this callback is to open a WebSocket on some public "echo" WS server (which "echoes" back a WS message it receives), send some WS message (text or binary) in the "open" callback and verify that our WS client receives the same message back. Thanks, Dmitry Karpov -----Original Message----- From: Daniel Stenberg <[email protected]> Sent: Sunday, June 18, 2023 2:47 PM To: Dmitry Karpov via curl-library <[email protected]> Cc: Dmitry Karpov <[email protected]> Subject: [EXTERNAL] Re: Send data before receiving data using the callback approach for WebSocket requests On Wed, 7 Jun 2023, Dmitry Karpov via curl-library wrote: > I think there should be WS_OPEN callback, called when WebSocket has > been successfully opened, which would allow to send data right after opening. I'm open for discussing/implementing this. Ideally if someone has a use case that needs this feature that we can work with to make sure it works fine. -- / 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
