TsgcWSPServer_sgcMethods › ClearQueue

ClearQueue Method

Discards queued retained publications pending on a channel.

Syntax

function ClearQueue(const aChannel: String): Boolean;

Parameters

NameTypeDescription
aChannelconst StringName of the channel whose queued publications must be discarded.

Return Value

True when a queue was found for the channel and emptied, False when no queue exists for that channel (Boolean)

Remarks

When clients publish with QoS Level 1 or Level 2 the server keeps the latest (Level 1) or the full history (Level 2) of messages per channel so late subscribers can receive them on connect or on Subscribe. ClearQueue drops those retained messages for the given channel without affecting currently connected subscribers.

Example

oProtocol.ClearQueue('news');

Back to Methods