diff options
Diffstat (limited to 'include/qntan/Qntan.h')
| -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, |
