Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TidHTTPServer and Orphaned Connection Threads
#7
(07-04-2019, 12:22 AM)rlebeau Wrote:
(07-03-2019, 01:54 PM)takyon_dg Wrote: I'm also setting the XMLDoc to nil after Active := False, which I now imagine will address the leak/'orphaned' threads.

That had nothing to do with your orphaned thread issue.  It was simply a bug in your code related to how you manage COM objects.
You're right (I thought it might create a leak).

New Indy is in there (6.2.5499), and that line. Same problem persists.

Any suggestions?

What I was thinking was I would track threadId's, their HTTP request and then in some other event handler, remove them from the list if they are properly closed and log the orphaned ones on a timer... I guess what I'm asking is, in terms of the TidHTTPServer events, is there (and which) one that gets triggered after the OnCommandGet (connection thread) is properly terminated/exited? I see OnContextCreated, but not sure which one might happen after. or would I have to gain access to the TidSchedulerOfThreadDefault and assign a method to the AfterExecute event?

Also, is there a straight-forward way to pull the HTTP header User-Agent from TidContext in OnException? I'm trying to isolate if a lot of my socket errors (including SSL handshake issues) are specific to an client OS or http control version. All the exceptions I have here seem to occur before OnCommandGet which I imagine means the datastream has not been identified/parsed as HTTP. My past attempts showed nothing in the input buffer to record and I wasn't sure what would happen if I try to use any of the read functions (AContext.Connection.Socket....)
Reply


Messages In This Thread
RE: TidHTTPServer and Orphaned Connection Threads - by takyon_dg - 07-04-2019, 03:41 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)