From ff75445dac3a75bb77e7291b07a2c61fb7c3d128 Mon Sep 17 00:00:00 2001 From: hiddenalpha.ch Date: Fri, 9 Oct 2026 18:30:18 +0200 Subject: Add some EXPERIMENTAL Websocket methods --- include/qntan/Qntan.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 759d739..09c0ed5 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -1798,6 +1798,31 @@ struct Qntan_Websocket { * `protoUpgradeRequest` contains the RAW http-to-websocket protocol * upgrade request message. */ + void (*sendMsg)( struct Qntan_Websocket**, + char const *payload, int64_t payload_len, int flg, + void(*onDone)(int,Qntan_Cls), Qntan_Cls ); + /* For a regular message, `flg` is usually set to zero. + * `flg & 1` indicates this msg is fragmented and more frames will + * follow. + * `flg & 2` sets the message to be a `text` frame. If not set, + * the message defaults to carry `binary` payload. + * `flg & 4` indicates that this is the last message on this + * websocket channel. If set, this has the same effect of calling + * `ws.shutdown()` after sending the message. + */ + void (*ping)( struct Qntan_Websocket**, + char const*payload, int payload_len, int flg ); + /* WARN: Signature likely will change soon. + * + * Send a ping message. + */ + void (*shutdown)( struct Qntan_Websocket** ); + /* WARN: Signature likely will change soon. + * + * Indicates we're done sending messages. The implementation + * will send a `ConnectionClose` (if none sent yet) message and then + * TCP-FIN the underlying connection. + */ }; -- cgit v1.3.1