TsgcWSPClient_Dataset › Methods › Broadcast
Broadcasts a message to all connected clients, optionally filtered by channel.
procedure Broadcast(const aText: String; const aChannel: String = ''; const aGuid: String = '');
| Name | Type | Description |
|---|---|---|
aText | const String | Payload to broadcast. |
aChannel | const String | Optional channel filter. When supplied, only clients subscribed to that channel receive the message. |
aGuid | const String | Optional Guid of the target server-side Dataset protocol instance. Leave empty to use the default. |
Unlike Publish (which targets subscribers of a channel), Broadcast is delivered to every connected client that matches the optional channel filter. Recipients receive the payload through their OnMessage event.
oProtocol.Broadcast('hello everyone');
oProtocol.Broadcast('channel update', 'news');