Francois PIETTE wrote: >> But there's another problem with WSocket_WSAAsyncGetHostByName. >> AKAIK, this old API doesn't support IPv6. New API GetAddrInfo() >> handles both IPv4 and IPv6 but it is blocking. Should I try to >> emulate asynchron lookups using a thread? Ideas are welcome. > > Having async operation is really mandatory. > I haven't looked at the API yet. > Maybe completion port is what is required ? I think it requires a > thread but a single one for all sockets is enough.
The signature is TGetAddrInfo = function(NodeName: PChar; ServName: PChar; Hints: PAddrInfo; var Addrinfo: PAddrInfo): Integer; stdcall; GetAddrInfo/GetNameInfo is fully thread-safe, allowing just one call at the same time was IMO an unnecessary limitation. One could use a thread pool with a queue for instance. I aggree that creating one thread per call might be overkill and most likely slow too. -- 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