Arno Garrels wrote: > Fastream Technologies wrote: >> Ok figured out your logic. It gives the same performance/memory leak as >> before. I think there is a problem with another part... > > This may not be your current problem, but it is a problem. > >> - destroy the client object fully >> - have the FClientList routine run in the listener thread as it is >> unprotected! >> - Could you advise a shut down destruction routine (Pascal now ok). > > Currently I've no idea how to do that, but I'm pretty sure it is possible. > This stuff is rather tricky, my solution is in TWSocketThrdServer, but > of course many other solutions are possible.
Forgot to mention that I would derive a MT TWsocketServer first that behaves as I like. It often helps a lot to reduce the problem to the basics. THttpServer is derived from TWSocketServer. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html >> >> SZ >> >> ----- Original Message ----- >> From: "Fastream Technologies" <[EMAIL PROTECTED]> >> To: "ICS support mailing" <twsocket@elists.org> >> Sent: Monday, March 20, 2006 6:01 PM >> Subject: Re: [twsocket] Server problem (leaking memory) >> >> >>> Hi, >>> >>> ----- Original Message ----- >>> From: "Arno Garrels" <[EMAIL PROTECTED]> >>> To: "ICS support mailing" <twsocket@elists.org> >>> Sent: Monday, March 20, 2006 4:25 PM >>> Subject: Re: [twsocket] Server problem (leaking memory) >>> >>> >>>> Fastream Technologies wrote: >>>>>> You say that you post a message to the worker thread to let it >>>>>> ThreadAttach. >>>>>> What do you do until the worker thread has attached?? You cannot just >>>>>> post a message, you have to wait until the workerthread has allocated >>>>>> the >>>>>> window. >>>>> >>>>> What do you suggest? What should I do? Would SendMessage work? But >>>>> there is no SendThreadMessage! >>>> >>>> If you have one thread per connection you post your message, then >>>> in a loop check a boolean flag that is set from within the worker >>>> thread when ThreadAttach returned. If you have multiple connections >>>> per thread you could use messages combined with Windows events or other >>>> sync-objects. >>>> The latter design is demonstrated with TWSocketThrdServer that I made >>>> to test ICS SSL in a multi-threaded environment. One connection per >>>> thread >>>> is demonstrated in demo ThrdSrv. >>> >>> I saw your waitformultiplemessages design and it works with attach. But >>> there is a big problem with detach: In my code, triggersessionclosed >>> runs in >>> the context of worker thread!!! What I want: >>> >>> - destroy the client object fully >>> - have the FClientList routine run in the listener thread as it is >>> unprotected! >>> - Could you advise a shut down destruction routine (Pascal now ok). >>> >>> Thanks, >>> >>> SZ >>> >>> -- >>> To unsubscribe or change your settings for TWSocket mailing list >>> please goto http://www.elists.org/mailman/listinfo/twsocket >>> Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be