@thegraid/wspbclient
TypeScript icon, indicating that this package has built-in type declarations

1.4.26 • Public • Published

wsbpclient

The Client-Group protocol (CgProto) has commands to Join, Leave, Send & Ack/Nak.

The semantics are managed by wspbserver; basically a 'chatroom' for websocket-protobuf client web-apps.

client apps join a group, get a client_id (~ the socket-id) and can then post messages to the group, and recieve copies of messages that other clients send. Messages are 'flow-controlled' by requiring an ACK from each client before proceeding to the next message, so clients stay synch'd.

Send forwards the payload (bytearray, presumably a protobuf for an inner protocol) to the Referee, and if the Referee ACKs it, then to the other members of the group (including the sender, unless nocc == true). The CgMessage contains other 'envelope' and message status info.

Each Group gets an implicit "group moderator" (or Referee) that ACK's all requests. This is replaced by an actual Referee app when such an app joins and declares itself to be the Referee. Such a Referee can enforce game rules & validate common state among clients.

Package Sidebar

Install

npm i @thegraid/wspbclient

Weekly Downloads

5

Version

1.4.26

License

ISC

Unpacked Size

197 kB

Total Files

39

Last publish

Collaborators

  • thegraid