> -----Ursprüngliche Nachricht----- > Von: Francois Piette [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 3. Februar 2006 11:21 > An: ICS support mailing > Betreff: Re: [twsocket] closing socket socket > > > > So I called DetachThread before Attach Thread, but now I get the > > exception that the socket cannot be detached. > > You can detach a socket from a thread only when you call > ThreadDetach within the same thread context > which called TreadAttach (or the creating thread context if > no attach has been done). See how > ThreadDetach and ThreadAttach are implemented: they save and > check thread ID.
Okay, but that is problematic for me. It may occur that the thread who created the socket is already gone but since it didn't close the socket properly (for what reason whatever) the communication dll is bound to close it. But now it can't since the socket has been created in another thread. > > btw: Have you read my previous messages ? I'm still convinced > you are confusing TThread class with > thread execution context. I do understand now that only the code within the execute method of a TThread descendant runs in the context of that thread. All other method of that TThread descendant won't unless being called from the own execute method. Greetings from a still learnig Markus -- 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