diff options
| author | hiddenalpha.ch | 2026-10-09 18:30:18 +0200 |
|---|---|---|
| committer | hiddenalpha.ch | 2026-10-09 18:30:18 +0200 |
| commit | ff75445dac3a75bb77e7291b07a2c61fb7c3d128 (patch) | |
| tree | a515d029d1737fb7dd29026d717997d596bb6830 /include/qntan | |
| parent | 423b0cb462485af351e94757d00050d5e1e133ee (diff) | |
| download | Qntan-ff75445dac3a75bb77e7291b07a2c61fb7c3d128.tar.gz Qntan-ff75445dac3a75bb77e7291b07a2c61fb7c3d128.zip | |
Add some EXPERIMENTAL Websocket methods
Diffstat (limited to 'include/qntan')
| -rw-r--r-- | include/qntan/Qntan.h | 25 |
1 files changed, 25 insertions, 0 deletions
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. + */ }; |
