Eric Fleming Bonilha wrote:
>> Yes, it is safe, however I would consider to use
>> WSocket_gethostbyname as well (more work).
>> 
> 
> What is the differenc? I See that wsocket_gethostbyname returns more
> information, but is there a reason to use it instead of the other
> method? 

WSocket_Synchronized_ResolveHost includes checks like
WSocketIsDottedIP() etc. which doesn't require to run
in a worker thread. I would start a worker thread only
in case wsocket_gethostbyname must be called.   

If you want to optimize this a bit more you could use
a thread pool, since creating threads takes time as well.
Perhaps something like TIcsAsyncDnsLookup that I wrote for
async name resolution with IPv6 recently, it has a thread
pool, however uses the GetAddrInfo() API which was easy to change: 
http://svn.overbyte.be:8443/svn/ics/branches/icsipv6/Delphi/Vc32/OverbyteIcsWSocket.pas
User and password both "ics".

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