COuld there be messages in the queue that were posted before threaddetach that arrive after threaddetach (in later sequence in GetMessage)? I am using V6. IOW, I get strange AV with a message of only "EAccessViolation" and no explanatory text in message pump dispatchmessage!
Regards, SZ ----- Original Message ----- From: "Francois Piette" <[EMAIL PROTECTED]> To: "ICS support mailing" <twsocket@elists.org> Sent: Wednesday, August 22, 2007 10:36 AM Subject: Re: [twsocket] ThreadDEtach with THttpConnection problem >> In triggersessionclosed, I postthreadmessage to a message handler in the >> same worker thread which then thread-detaches and posts the object to >> listener thread. However, in every 1-2 hours, under heavy load, the >> worker >> thread gives an AV which I suspect is due to a recv/send callback event >> being launched after threaddetach. How can I prevent this? > > If you had looked at the source code, you could have seen that when > ThreadDetach is called, the socket is asked to stop sending notifications > (WSAASyncSelect is called with nul mask) and the hidden window is > cancelled. > So technically speaking, no notification can take place before you attach > the socket again to a thread in which case a new hidden window is assigned > and WSAASyncSelect called to request notifications from winsock. > > In ICS-V6, the hidden window is shared by several components. ThreadDetach > unregister the messages which where used by the component. > > -- > [EMAIL PROTECTED] > Author of ICS (Internet Component Suite, freeware) > Author of MidWare (Multi-tier framework, freeware) > 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 -- 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