>I think you should use only one thread for all socket operation within your application and one thread for each lengthy processing/computation you have to do. The rule is to avoid lengthy processing within the thread doing communication.
Yes, that's exactly I intended to do except I don't need long processing so just a single thread inside DLL for socket message loop >In my opinion, you should revise you design to better fit the programming model used for ICS. Otherwise you'll end up with a complex application difficult to maintain a prone to errors. Well, I can't imagine something else without complicating the structure. I need several functions to sync-ly communicate thru sockets. So WaitFor-s and again WaitFor-s... >See above. Pausing/resuming the socket shouldn't be used, specially if you have your own worker thread. Just have the socket event handler blocked waiting for some synchronization object. You mean blocking the entire message loop? I'll implement it myself without using socket method as I don't know what set of sockets would exist. >Yes, you have to detach the socket from the worker thread before destroying the socket. Got it! >As I said before, you can avoid thread Attach/detach with careful design. Having to use attached/detach is the sign of a too complex design. Another ways to reach comatibility between sync and async is are ugly (Synchronize) or complicated (SendMessage or smth else). I'll try with attach/detach -- Anton -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be