Eric, >> Sorry I misunderstood. I thought you used method DnsLookup. >> So in this case it is simple to fix, call method DnsLookup and >> connect with a dotted IP address from the OnDnsLookupDone event >> handler. >> > > Hi Arno > > Thanks for the clarification > > So, if I use the method DnsLookup all the requests will be serialized > correct?
Correct, and it won't block the calling thread. > > If I try to connect to several different DNS that takes several > seconds to resolve (I tested in my customer site and it actually > takes 5 to 6 seconds to resolve), it means that if it is serialized, > the last request will take very long to respond That's true as well. > Instead, if I spaw a thread (and release after use) for each lookup > and use the routine WSocketResolveHost from the new thread context, I > can response many addresses all at once, correct? In parallel yes, the more CPUs or cores the better. > Is it safe to use WSocketResolveHost routine? I can translate the > result to dotted IP address easily Yes, it is safe, however I would consider to use WSocket_gethostbyname as well (more work). -- 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