By Admin on Monday, 18 May 2020
Category: All

UpdateMode in DataSet Protocol

sgcWebSockets Dataset Subprotocol allows to broadcast database changes to all client connected. From sgcWebSockets 4.3.8 this protocol allows 2 update modes:

1. Replicate Table: protocol updates dataset clients when a dataset has changed.

2. Notify Updates: protocol notifies clients when a dataset has changed. 

Replicate Table 

This mode tries to solve a common scenario where a table is replicated for all connected clients, example, if you have a server with a stock quotes table, you want broadcast stock changes to all clients, but you don't want that a client can connect to your database. So, every time there is a change in any stock quotes, the record information will be broadcasted to all connected clients. Every client will read the record and update his own table.

You can check in Demos folder, SQLLite/MultipleDatabase demo.

Configure Dataset Server

Create a new Dataset Protocol Server and configure using the following properties

 Configure Dataset Client

Create a new Dataset Protocol Client and configure using the following properties

Notify Updates 

This mode tries to solve an scenario where server and clients share a single database (server and clients are connected to the same physical database) and clients want to be notified every time other client has done any change on a dataset.

You can check in Demos folder, SQLLite/SingleDatabase demo.

Configure Dataset Server

Create a new Dataset Protocol Server and configure using the following properties

Configure Dataset Client

Create a new Dataset Protocol Client and configure using the following properties

Related Posts