Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disconnected TCPServer thread won't terminate
(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:

    if Assigned(AContext.Data) = False then
      st := 'WebSocket Rogue (' + AContext.Binding.PeerIP + ')';
      MadExcept.NameThread(GetCurrentThreadID, st);
      st := st + ' ' + IntToStr(GetCurrentThreadID);
      AContext.Connection.Disconnect;  // rogue connection
      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  Have there been any changes since then might be relevant to this situation?

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)