summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorhiddenalpha.ch2026-10-07 23:00:34 +0200
committerhiddenalpha.ch2026-10-07 23:00:34 +0200
commit423b0cb462485af351e94757d00050d5e1e133ee (patch)
tree8665913ab7f3ab012b3ab11e7871b5f4e992696f /include
parent4e15ec57f90d8d0d44b821a4dce7ae3c65f2ec52 (diff)
downloadQntan-423b0cb462485af351e94757d00050d5e1e133ee.tar.gz
Qntan-423b0cb462485af351e94757d00050d5e1e133ee.zip
Experiment how to design a websocket
Diffstat (limited to 'include')
-rw-r--r--include/qntan/Qntan.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h
index f06a099..759d739 100644
--- a/include/qntan/Qntan.h
+++ b/include/qntan/Qntan.h
@@ -96,6 +96,7 @@ struct Qntan_JsonDec;
struct Qntan_JsonDec_Mentor;
struct Qntan_JsonTreeDec_JsonNode;
struct Qntan_JsonTreeDec;
+struct Qntan_Websocket;
struct Qntan_XmlDec;
struct Qntan_XmlDec_Mentor;
struct Qntan_HttpClient_Exchg_Opts;
@@ -1780,6 +1781,34 @@ struct Qntan_JsonTreeDec {
+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,
+ 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
+ * processing. Initially, it points to the 1st byte AFTER the
+ * initial protocol upgrade request.
+ * `socket_unref` is an (OPTIONAL) destructor, called as soon the
+ * library does not need `socket` anymore.
+ * `protoUpgradeRequest` contains the RAW http-to-websocket protocol
+ * upgrade request message.
+ */
+};
+
+
+
+
+
+
+
+
+
+
#ifndef Qntan_XmlDec_pause
# define Qntan_XmlDec_pause(A) (*A)->pause(A)
#endif