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