Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disconnected TCPServer thread won't terminate
#6
(04-18-2022, 08:58 PM)kbriggs Wrote: Yes, those lists are TObjects with properties protected by getters, setters, and functions wrapped in TMultiReadExclusiveWriteSynchronizer blocks. I'm pretty confident those are solid as they've been working for years.

That doesn't rule out the possibility of a deadlock/mismanaged lock, though.

(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. When the socket is disconnected, the TIdContext.OnRun event (which is called in a loop for the lifetime of the thread, and is responsible for firing the server's OnExecute event on each iteration) should return False, which will cause the thread to call Stop() on itself, and the default behavior of Stop() in a non-pooled server is to call Terminate().

(04-18-2022, 08:58 PM)kbriggs Wrote: I would of course prefer to figure out the real problem.

Then you are just going to have to debug into Indy's code for yourself to see what is really happening.

Reply


Messages In This Thread
RE: Disconnected TCPServer thread won't terminate - by rlebeau - 04-18-2022, 10:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)