TsgcWSPClient_sgcMethods › Publish

Publish Method

Publishes a message to all clients subscribed to a channel.

Syntax

procedure Publish(const aText, aChannel: String; const aGuid: String = ''; const aQueue: TwsQueue = queueLevel0);

Parameters

NameTypeDescription
aTextconst StringPayload to publish.
aChannelconst StringChannel the message is published on; only clients subscribed to this channel receive it.
aGuidconst StringOptional Guid of the target server-side sgc protocol instance. Leave empty to use the default.
aQueueconst TwsQueueQueue level used when the server applies transactional queuing to the publication.

Remarks

Delivers the payload to every connected client subscribed to the channel through their OnEvent handler. When QoS is set to Level 1 or 2, the message is assigned an Id and the server acknowledges delivery through OnAcknowledgment.

Example

oProtocol.Publish('breaking news', 'news');

Back to Methods