TsgcWebSocketServerProperties › NotifyEvents

NotifyEvents Property

Controls how threaded WebSocket events are synchronized with the main VCL thread.

Syntax

property NotifyEvents: TwsNotifyEvent read FNotifyEvents write SetNotifyEvents;

Default Value

neAsynchronous

Remarks

The server receives every message on a worker thread and has to marshal events to the code handler safely. neAsynchronous (default) queues events and flushes them to the main thread asynchronously, keeping worker threads responsive. neSynchronous blocks the worker thread until the main thread has processed the event — safer when handlers modify shared state, but slower. neNoSync dispatches handlers directly on the worker thread with no synchronization; use it only when your code is fully thread-safe or when you do not touch VCL controls from handlers.

Example


oServer := TsgcWebSocketServer.Create(nil);
oServer.NotifyEvents := neNoSync;
oServer.Active := true;

Back to Properties