TsgcWSPClient_sgcMethods › Subscribe

Subscribe Method

Subscribes the client to a custom channel.

Syntax

procedure Subscribe(const aChannel: String; const aGuid: String = '');

Parameters

NameTypeDescription
aChannelconst StringName of the channel to subscribe to.
aGuidconst StringOptional Guid of the target server-side sgc protocol instance. Leave empty to use the default.

Remarks

Sends a subscribe request for the given channel. When the server confirms the subscription, the OnSubscription event fires. After subscribing, messages published to the channel are delivered through OnEvent.

Example

oProtocol.Subscribe('news');

Back to Methods