diff options
| author | hiddenalpha.ch | 2026-10-12 23:14:25 +0200 |
|---|---|---|
| committer | hiddenalpha.ch | 2026-10-12 23:14:25 +0200 |
| commit | 261b233ee9ad13d57043b22447c0a645c6648b05 (patch) | |
| tree | 54704a7eceb4ef254d8a89150da263575a17b2e0 /include/qntan | |
| parent | 1687535110c8e69d18bc72c2c5cddedf966865cc (diff) | |
| download | Qntan-261b233ee9ad13d57043b22447c0a645c6648b05.tar.gz Qntan-261b233ee9ad13d57043b22447c0a645c6648b05.zip | |
tinker around with Websocket.
Diffstat (limited to 'include/qntan')
| -rw-r--r-- | include/qntan/Qntan.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 9b3df46..d743b59 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -1843,6 +1843,8 @@ struct Qntan_Websocket { void (*reset)( struct Qntan_Websocket**, struct Qntan_Socket**socket, void(*socket_unref)(struct Qntan_Socket**), char const*protoUpgradeRequest, int protoUpgradeRequest_len, + void (*onWebsocketMsg)(int flgs,char const*buf,int buf_len,Qntan_Cls a2,void(*onMsgConsumed)(Qntan_Cls a3),Qntan_Cls a3), + Qntan_Cls a2, void(*onDone)(int err,Qntan_Cls cls), Qntan_Cls cls ); /* Initializes this instance to be used on the given `socket`. * WARN: `socket` then will be kept internally, for further message @@ -1852,6 +1854,13 @@ struct Qntan_Websocket { * library does not need `socket` anymore. * `protoUpgradeRequest` contains the RAW http-to-websocket protocol * upgrade request message. + * `onWebsocketMsg` gets called as soon there's event data available. + * `flgs & 1` means `buf` is of type `utf8`. + * `flgs & 2` this is "just another chunk" to the same message as before. + * `flgs & 4` means this is the last chunk of this message. + * `flgs & 8` means this is a `PING` message. + * `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, |
