From 046fa078f90939891256914014f74804e8ffa963 Mon Sep 17 00:00:00 2001 From: hiddenalpha.ch Date: Sun, 18 Oct 2026 19:45:37 +0200 Subject: websocket tinker tinker --- include/qntan/Qntan.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'include') 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. */ }; -- cgit v1.3.1