TsgcWebSocketClient属性 › QueueOptions

QueueOptions 属性

将出站 Text、Binary 和 Ping 消息排队,以便在连接线程上串行发送。

语法

property QueueOptions: TsgcWSQueueClient_Options read FQueueOptions write SetQueueOptions;

默认值

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

备注

默认情况下,消息直接在调用线程上写入。指定队列级别(qmLevel1qmLevel2qmLevel3)后,消息将入队并从连接线程依次发送,避免多个线程同时调用 WriteDataPing 时产生锁竞争。qmLevel1 的消息在 qmLevel2 之前处理,qmLevel2qmLevel3 之前处理,因此优先级较高的类别(例如 ping)可先于有效载荷传递。

示例


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

返回属性