Eric, 

> I have several instances (More than 20) of TWSocket (TCP Client),
> running all on the same thread (Secondary thread, not main thread). 
> 
> Each instance will connect to a different DNS address from dyndns.org
> 
> Sometimes, several addresses are offline, or even the internet
> connection is not available, when we try to connect it locks up the
> thread for several seconds, and consequently all instances will lock
> up too, maybe something related to DNS lookup.

The thread should not block, method DnsLookup internaly calls Win API
WSAAsyncGetHostByName which is an asynchronous function, however 
WSAAsyncGetHostByName does not resolve multiple requests concurrently.
So multiple calls to DnsLookup from the same thread context are 
serialized.
http://msdn.microsoft.com/en-us/library/ms741522%28VS.85%29.aspx

-- 
Arno Garrels
--
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