11-18-2019, 02:18 PM
(11-16-2019, 07:54 PM)rlebeau Wrote: Rather than doing a full Disconnect() in a worker thread, I would probably just Close() the IOHandler to close the underlying socket, let the reading thread detect the closure (ie, a read failure) and terminate itself, and then have the main thread detect that (or have the worker signal the main thread) to Disconnect() the client to free up the thread.
I tried:
IdTelnet1.IOHandler.Close;
instead of:
IdTelnet1.Disconnect;
(calls from the UI thread)
That fixed the app blocking problem, but the component no longer called IdTelnet1.Disconnected event, which I use.
The threaded disconnect solution above seems to work better.
Thanks

