1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

smd: add use class base index

In addition to the well-known classes, add a user class base bit offset
so distributed user applications can cleanly send messages using SMD
This commit is contained in:
Andy Green 2021-01-01 14:50:45 +00:00
parent 4b2c0fdc1d
commit 619ef5eb17
2 changed files with 8 additions and 1 deletions

View file

@ -52,6 +52,8 @@ enum {
* Something happened on the network, eg, link-up or DHCP, or captive
* portal state update
*/
LWSSMDCL_USER_BASE_BITNUM = 24
};
/**

View file

@ -44,13 +44,18 @@ appear as soon as a participant appears that wants them. The message generation
action should be bypassed without error in the case lws_smd_msg_alloc()
returns NULL.
Various well-known high level classes are defined but also a bit index
`LWSSMDCL_USER_BASE_BITNUM`, which can be used by user code to define up to 8
private classes, with class bit values `(1 << LWSSMDCL_USER_BASE_BITNUM)` thru
`(1 << (LWSSMDCL_USER_BASE_BITNUM + 7))`
## Messaging guarantees
Sent messages are delivered to all registered participants whose class mask
indicates they want it, including the sender. The send apis are threadsafe.
Locally-delivered message delivery callbacks occur from lws event loop thread
context 0 (the only one in the default case LWS_MAX_SMP = 1). Clients in
context 0 (the only one in the default case `LWS_MAX_SMP` = 1). Clients in
different processes receive callbacks from the thread context of their UDS
networking thread.