TsgcSSEClient › Properties › NotifyEvents
Controls how the events are dispatched to the main thread.
property NotifyEvents: TwsNotifyEvent read FNotifyEvents write FNotifyEvents;
neAsynchronous (neNoSync in console applications and DLLs)
The stream is read on a background thread. neAsynchronous queues the events and runs them on the main thread, neSynchronous waits until the main thread has run each event, and neNoSync fires the events directly on the background thread, which suits console applications and services but requires thread-safe handlers. OnReconnect and OnBeforeConnect always run on the background thread.
oSSE.NotifyEvents := neNoSync;
oSSE.Open;