> > Hello Markus, > >> This is done because each thread does more things than just sending >> receiving. > > The message was meant because many people think they need a thread per > communication TWSocket channel. So I assume you have your own reason to > have a thread. > > What you can do is Create and destroy TWSocket IN the Execute method of > the thread (and set multithreaded to True). the only thing esle you have > to do is call the message pump (your own written of one of TWSocket). > > The other thing is use ThreadAttache and Detach to attach the TWSocket > to the thread after create in another thread. This also have to be done > in the right thread context. (also Multithreaded True). > > At the moment your TWSockets are running in main thread context because > none of the above is true. > > Another thing you can do is leave all sockets in main thread (or in a > single thread) and exchange data by posting messages to the threads. > What the most logical is that is your own opinion and by design of > course. >
Hello, thanks for clarification. It doesn't matter that the one thread which communicates via TWSocket doesn't reside in the same DLL as the TWSocket created? I simply don't have access to the TWSocket itsself from that thread. Another thing is, that the other DLL which normally only exposes procedures/functions for setting up a connection and for writing (receiving is done via callback mechanism) has one single thread for all components/sockets living there who only sits there and processes the Windows messages for them. Up to now this did work and after introducing it all other components startet to fire their requests again. So I am on a doable way as long as I get the closing of the socket done without hanging or crashing anything. The hints given by Francois this afternoon still have to be tested by me, but I hope those solve the problem with the hanging when closing (but later the app. responds again... mh...). Greetings 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