> ---- Quote from Arno:
> I guess it's worth a trial to simply ThreadAttach all
> clients in
> the destructor after all threads terminated.
> ..
> ----
> I'm sorry, I don't mean to be obtuse, but what would
> that do?

That creates a new hidden window in the new, current thread
context. The old window in worker thread context has been
destroyed when the worker threads terminated, so message
handling will work again. Note that OnClientDisconnect
does not fire when clients are disconnected from the
destructor, that's the same behaviour as in TWSocketServer
as well.  

> I was thinking I could call DisconnectAll() before
> calling the destructor of the thrdserver... 

You need to wait and process messages until all
clients are actually closed, that is when ClientCount 
becomes 0. Clients are removed from the client list when 
SessionClosed/ClientDisconnect fires. 
But... if csDestroying is in the component states it won't 
never fire.
csDestroying is already in the states when you call 
DisconnectAll() from the destructor of the server's owner component.
If you created the server with a nil owner, no problemo. 

Arno Garrels

>    -dZ.
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