TsgcTCPClient › Properties › NotifyEvents
Controls how connection events are dispatched to the main thread.
property NotifyEvents: TwsNotifyEvent read FNotifyEvents write SetNotifyEvents;
neAsynchronous
Three modes are available: neAsynchronous (default) queues events and synchronises them with the main thread asynchronously; neSynchronous blocks the connection thread until the main thread has processed the event (uses TThread.Synchronize); neNoSync fires events directly on the connection thread, which is faster but requires the event handler to be thread-safe.
oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.NotifyEvents := neSynchronous;
oTCP.Active := true;