> I also recall that Pong message should include all data received in Ping > message, what can be 0 or more bytes. This can complicate things if server > will send lots of data, I do not know if there is any upper limit for this.
I dealt with some WS client/servers that didn't use Ping/Pong exchange for "keep alive" purposes. Instead, they used some proprietary mechanism based on text/binary messages with some opaque data. So I agree that automatic Pong reply on Ping should be optional, but probably enabled by default. > I also recall that Pong message should include all data received in Ping > message, what can be 0 or more bytes. This can complicate things if server > will send lots of data, I do not know if there is any upper limit for this. Ping/Pong are control messages, so they are quite short (< 125 bytes). -----Original Message----- From: curl-library <curl-library-boun...@cool.haxx.se> On Behalf Of Daniel F via curl-library Sent: Saturday, July 3, 2021 4:56 AM To: libcurl development <curl-library@cool.haxx.se> Cc: dan...@poradnik-webmastera.com Subject: Re: curl websockets W dniu 2021-07-03 12:36, Felipe Gasper via curl-library napisał(a): >> On Jul 2, 2021, at 7:47 PM, Nicolas Mora via curl-library >> <curl-library@cool.haxx.se> wrote: >> >>>> Alternatively, have separate curl_ws_send_text and >>>> curl_ws_send_binary functions? >>> That could certainly work and would save users sending text from >>> having to set a "this is text" bit. My personal preference is to >>> rather keep it to one function with the bits for type, but I'm here >>> to listen in what peeps want and I will not push my own preferences >>> if I'm in a minority. >> Alternatively, a curl_ws_send_ping and curl_ws_send_pong would be >> useful. >> Also, considering sending a pong response when a ping request is sent >> automatically, unless it's specified by the calling program somehow. > > IMO curl shouldn’t expose this to the application; instead, have the > caller give a ping period and a response timeout. And yeah, curl > should respond to pings automatically. Ability to disable automatic Pong responses and sending them manually is useful for testing, e.g. to verify that my server-side code works properly. So I would like to have ability to do this. I also recall that Pong message should include all data received in Ping message, what can be 0 or more bytes. This can complicate things if server will send lots of data, I do not know if there is any upper limit for this. -- Daniel ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html