04-19-2022, 05:14 AM
(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?