Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdTelnet Disconnect
#1
I'm using telnet client in my app, to access streaming market data.
It works ok for Windows and iOS, but on Android the app hangs
for several seconds when telnet.Disconnect is called.  So much that
Android detects the app is stalled and terminates it.

I understand that Connect and Disconnect can block the
execution, so they are not to be called from the UI thread.
But why Disconnect takes so long ?

One guy suggested on stackoverflow that the reader thread
was locked or not finishing, and that blocked the Disconnect call.

So I tried to create a thread dedicated to disconnect.
It seems to work   Smile 

Code:
procedure TForm1.ThreadedTelnetDisconnect;
var aThreadDisconnect:TThread;
begin
  aThreadDisconnect := TThread.CreateAnonymousThread(
      procedure begin
        IdTelnet1.Disconnect;
      end);
  aThreadDisconnect.start();
end;
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)