TsgcWSPClient_DatasetMethods › Broadcast

Broadcast Method

Broadcasts a message to all connected clients, optionally filtered by channel.

Syntax

procedure Broadcast(const aText: String; const aChannel: String = ''; const aGuid: String = '');

Parameters

NameTypeDescription
aTextconst StringPayload to broadcast.
aChannelconst StringOptional channel filter. When supplied, only clients subscribed to that channel receive the message.
aGuidconst StringOptional Guid of the target server-side Dataset protocol instance. Leave empty to use the default.

Remarks

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.

Example

oProtocol.Broadcast('hello everyone');
oProtocol.Broadcast('channel update', 'news');

Back to Methods