TsgcWebSocketServer › Properties › NotifyEvents
Controls how threaded WebSocket events are synchronized with the main VCL thread.
public TwsNotifyEvent NotifyEvents { get; set; }
neAsynchronous
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.
oServer = new TsgcWebSocketServer();
oServer.NotifyEvents = TwsNotifyEvent.neNoSync;
oServer.Active = true;