Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disconnected TCPServer thread won't terminate
#7
(04-18-2022, 10:36 PM)rlebeau Wrote:
(04-18-2022, 08:58 PM)kbriggs Wrote: What would happen if I tried to terminate the thread myself like this:

You can try, but it shouldn't make a difference in this case.

It did make a difference. I changed that part of my OnExecute code to this:

Code:
    if Assigned(AContext.Data) = False then
    begin
      st := 'WebSocket Rogue (' + AContext.Binding.PeerIP + ')';
      MadExcept.NameThread(GetCurrentThreadID, st);
      st := st + ' ' + IntToStr(GetCurrentThreadID);
      LogData.Debug(st);
      AContext.Connection.Disconnect;  // rogue connection
      Sleep(1000);
      TIdYarnofThread(AContext.Yarn).Thread.Terminate;  // uses IdSchedulerofThread
    end else

I put that online and checked back 3 hours later. My log had 127 rogue entries recorded (most from Brazil this time) but not a single one of their threads was running. So problem solved, I guess?

I haven't updated my Indy install in quite a while. I have version 10.6.2.5469.  Have there been any changes since then might be relevant to this situation?
Reply


Messages In This Thread
RE: Disconnected TCPServer thread won't terminate - by kbriggs - 04-19-2022, 05:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)