> I looked this up and it maybe this issue here, Being a chat 
> system and assuming SocketServer.Client is the list of connected 
> users, is it possible that users are connecting and disconnecting 
> while you are still iterating the list of users? 

Assuming your server is not using any threads, no messages will be
processed while your function is running to loop through the connected
clients, so there can be no change in the number of clients, no
connections or disconnections. 

If you want to test this, added logging as you enter and exit the
function with SocketServer.ClientCount to check it does not change.

The danger in loops like this is doing disconnections, which clearly
does change the ClientCount, so you generally do them backwards. 



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

Reply via email to