On Oct 11, 2007, at 06:47, Arno Garrels wrote: > Iterating thru Srv.Clients is not the way to go!! It is not > thread-save and will most likely throw strange AVs. Instead > iterate thru the thread-list and post a custom message to each > thread, the inside the thread iterate thru each thread's > client list, see TWSocketThrdServer.DisconnectAll as example. > Now one problem is that TWSocketThrdServer has no public property > ThreadList and TWsClientThread.PumpMessages doesn't fire an event > OnMessage. So the code has to be tweaked a little bit for common use.
So, would you recommend that I extend the component and override DisconnectAll to, say, fire an event that I could hook on to send the messages; and then call DisconnectAll() from my worker thread instead of using the loop? If so, we should add something like this to the component itself, no? (I could provide the code when I'm done with it.) > The only reason why I started writing this component was to derive > a SSL multi-threaded server from it only to be able to test > thread-safety of the SSL code. Are you suggesting the component is not stable for a production application? Thanks for your help, Arno. dZ. -- 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