Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdTelnet Disconnect
#4
(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
Reply


Messages In This Thread
TIdTelnet Disconnect - by omarreis - 11-15-2019, 01:03 PM
RE: TIdTelnet Disconnect - by kudzu - 11-15-2019, 06:49 PM
RE: TIdTelnet Disconnect - by rlebeau - 11-16-2019, 07:54 PM
RE: TIdTelnet Disconnect - by omarreis - 11-18-2019, 02:18 PM
RE: TIdTelnet Disconnect - by rlebeau - 11-22-2019, 02:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)