Arno Garrels wrote:
> Access to the protected TDictonary object is thread-safe, however
> it is not calling methods and access properties of the client objects.
> You have to communicate with the clients using Window messages.
> Look at how TWSocketThrdClient defines a new message ID and overrides
> its WndProc method.

And even that won't be safe. If, for instance, the client has been 
detached from its thread, that is its Handle property is zero, and you call
PostMessage(Client.Handle..) the handle will be recreated in the context
of the calling thread, which will likely cause an error when the component
finally destroys the Handle in main thread context.

Bottomline: Do not use this class if you ever need to access client objects
from outside their own event handlers. Instead TWSocketServer should be used,
do lengthy, blocking tasks in a worker thread.

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to