summaryrefslogtreecommitdiff
path: root/include/qntan
diff options
context:
space:
mode:
authorhiddenalpha.ch2026-10-18 19:45:37 +0200
committerhiddenalpha.ch2026-10-18 19:45:37 +0200
commit046fa078f90939891256914014f74804e8ffa963 (patch)
treedd7ffb73f056565157507017423ed72fb63f07f6 /include/qntan
parent261b233ee9ad13d57043b22447c0a645c6648b05 (diff)
downloadQntan-046fa078f90939891256914014f74804e8ffa963.tar.gz
Qntan-046fa078f90939891256914014f74804e8ffa963.zip
websocket tinker tinker
Diffstat (limited to 'include/qntan')
-rw-r--r--include/qntan/Qntan.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h
index d743b59..a7d2c85 100644
--- a/include/qntan/Qntan.h
+++ b/include/qntan/Qntan.h
@@ -1840,6 +1840,7 @@ struct Qntan_Websocket {
/* CoDec for
* https://www.rfc-editor.org/info/rfc6455/
*/
+ //
void (*reset)( struct Qntan_Websocket**,
struct Qntan_Socket**socket, void(*socket_unref)(struct Qntan_Socket**),
char const*protoUpgradeRequest, int protoUpgradeRequest_len,
@@ -1862,6 +1863,7 @@ struct Qntan_Websocket {
* `flgs & 16` means this is a `PONG` message.
* `flgs & 32` this is a "connection-close" websocket message.
*/
+ //
void (*sendMsg)( struct Qntan_Websocket**,
char const *payload, int64_t payload_len, int flg,
void(*onDone)(int,Qntan_Cls), Qntan_Cls );
@@ -1874,18 +1876,35 @@ struct Qntan_Websocket {
* 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** );
+ //
+ void (*pong)( struct Qntan_Websocket**,
+ char const*payload, int payload_len, int flg );
/* WARN: Signature likely will change soon.
*
- * Indicates we're done sending messages. The implementation
+ * Send a pong reply. `payload` MUST contain the data received in
+ * the `ping` we respond to.
+ */
+ //
+ void (*shutdown)( struct Qntan_Websocket**,
+ char const*payload, int payload_len,
+ void(*onDone)(int err,Qntan_Cls arg), Qntan_Cls arg );
+ /* Indicates we're done sending messages. The implementation
* will send a `ConnectionClose` (if none sent yet) message and then
* TCP-FIN the underlying connection.
+ *
+ * `payload_len` MUST be in range `0..125`. `payload[0]` (if status
+ * present) MUST be the most significant octet of the status code of
+ * type u16. `payload[1]` (if status present) MUST be the least
+ * significant octet of the status code of type u16.
+ *
+ * `err` below zero indicates errors.
*/
};