TsgcWebSocketClientProperties › QueueOptions

QueueOptions Property

Queues outgoing Text, Binary and Ping messages so they are serialised on the connection thread.

Syntax

public TsgcWSQueueClient_Options QueueOptions { get; set; }

Default Value

Text.Level=qmNone, Binary.Level=qmNone, Ping.Level=qmNone

Remarks

By default messages are written directly on the caller thread. Assigning a queue level (qmLevel1, qmLevel2 or qmLevel3) enqueues them and sends them sequentially from the connection thread, avoiding locks when several threads call WriteData or Ping at once. Messages at qmLevel1 are processed before qmLevel2, and qmLevel2 before qmLevel3, so higher-priority categories (for example ping) can be delivered ahead of payloads.

Example


oClient = new TsgcWebSocketClient();
oClient.URL = "wss://www.esegece.com:2053";
oClient.QueueOptions.Ping.Level = TwsQueueLevel.qmLevel1;
oClient.QueueOptions.Text.Level = TwsQueueLevel.qmLevel2;
oClient.QueueOptions.Binary.Level = TwsQueueLevel.qmLevel2;
oClient.Active = true;

Back to Properties