TsgcWebSocketServer_HTTPAPIProperties › Asynchronous

Asynchronous Property

Enables fire-and-forget sends: the caller returns immediately and completion is signalled through the OnAsynchronous event.

Syntax

public bool Asynchronous { get; set; }

Default Value

False

Remarks

By default (False) each outbound send blocks the caller until the http.sys driver confirms the bytes have been handed to the network stack. Set Asynchronous to True to issue overlapped sends through IOCP: the call returns as soon as the buffer is queued and completion is reported later via the OnAsynchronous event. This gives higher throughput when fanning out broadcast messages to many clients, at the cost of an extra callback hop on every send. The Options.WriteTimeOut/WriteTimeoutInterval knobs only apply when Asynchronous is False.

Example


oServer = new TsgcWebSocketServer_HTTPAPI();
oServer.Host = "127.0.0.1";
oServer.Port = 80;
oServer.Asynchronous = true;
oServer.Active = true;

Back to Properties