TsgcWebSocketServer_HTTPAPI › Properties › QueueOptions
Serialises outbound messages through an internal per-connection queue to prevent contention between threads.
property QueueOptions: TsgcWSQueueServer_Options read FQueueOptions write SetQueueOptions;
Text.Level=qmNone, Binary.Level=qmNone, Ping.Level=qmNone
When enabled, messages are placed in an internal queue and sent in the context of the connection thread instead of the caller's thread — this removes the locking needed when several threads write to the same connection simultaneously. Each message type (Text, Binary, Ping) is a sub-object with its own Level property, which assigns an independent priority: qmNone skips the queue (default), qmLevel0 is processed first, then qmLevel1 and finally qmLevel2. For example, setting Text.Level and Binary.Level to qmLevel2 and Ping.Level to qmLevel1 guarantees pings are delivered before ordinary traffic.
QueueOptions is not supported by the HTTP.sys server. The queue is switched off as the server starts: the three levels are reset to qmNone, the OnError event reports it, and messages are written inline on the caller thread. A level assigned after the server is already listening is reset the same way on every new connection. The http.sys engine is driven by IOCP completions and has no per-connection loop to drain a queue from, so a queued message would never reach the socket.
oServer := TsgcWebSocketServer_HTTPAPI.Create(nil);
// QueueOptions is not supported here, the three levels are reset to qmNone on start
oServer.Active := true;