Setting ASender.Disconnect := True in a CommandHandler will cause a
deadlock when TIdCommandHandler.DoCommand() calls
AContext.Connection.Disconnect(), as TIdCmdTCPClient.Disconnect() will attempt
to wait for the calling thread to terminate.
In procedure TIdCmdTCPClientListeningThread.Run(), before
"FClient.IOHandler.CheckForDisconnect" add:
"if not Terminated then"
In procedure TIdCmdTCPClient.Disconnect(ANotifyPeer: Boolean), after
"begin" add:
if Assigned(FListeningThread) and not IsCurretThread(FListeningThread) then
begin
FListeningThread.Terminate;
inherited Disconnect(ANotifyPeer);
Exit;
end;
Original issue reported on code.google.com by gambit47 on 26 Jun 2012 at 11:20
Original issue reported on code.google.com by
gambit47
on 26 Jun 2012 at 11:20