From: SourceForge.net <no...@so...> - 2005-04-26 22:46:41
|
Bugs item #824251, was opened at 2003-10-15 09:47 Message generated for change (Comment added) made by davygrvy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=824251&group_id=10894 Category: 27. Channel Types Group: obsolete: 8.3.2 Status: Open Resolution: None Priority: 7 Submitted By: Nobody/Anonymous (nobody) Assigned to: Andreas Kupries (andreas_kupries) Summary: async client sockets block for DNS Initial Comment: The geturl documentation claims that, geturl will return immediatly with a token if the -command option is invoked. If geturl can not make the initial socket connection to a url, it blocks until the timeout expires and calls the -command proc before geturl has returned a token. This causes at least the following two problems: 1. The block causes any following geturl calls to hang before processing. This destroys the asynchronious operation. 2. It invokes the -command proc with a token that is as yet unknown to the general processing loop. gm...@wx... ---------------------------------------------------------------------- >Comment By: David Gravereaux (davygrvy) Date: 2005-04-26 15:46 Message: Logged In: YES user_id=7549 getaddrinfo() works on windows, too. But where's the spec for timeout behavior? Just for fun, I've been experimenting with an external helper app to be used for async name lookups. If we launch it in an async pipe, problem solved. http://cvs.sf.net/viewcvs.py/iocpsock/iocpsock/tclname.c?rev=HEAD&view=auto ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2005-04-26 14:44 Message: Logged In: YES user_id=79902 Joe English suggests using getaddrinfo() for name lookups instead of gethostbyname(). In terms of portability, it seems to be available identically on Linux, Solaris and IRIX for sure (no access to other Unix platforms!) and it is also the subject of standardization (see POSIX 1003.1g and RFC 2553). IOW, perfect! And if there are platforms which don't support it, we could detect that in configure and fall back to the bad old gethostbyname() for [socket -async] processing. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2003-11-13 06:42 Message: Logged In: YES user_id=79902 The problem is the sheer complexity of stuff hidden under the covers. If it was just DNS (or if there was a sensible way of parsing the config files across all platforms), that'd be so much easier. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-11-13 01:07 Message: Logged In: YES user_id=7549 I can name that extension on windows in 45 minutes.. Does BSD have anyway to do an async gethostbyname? Does this fall into OS specific for sol/irix/linux/etc.. ? ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2003-10-15 13:49 Message: Logged In: YES user_id=79902 Problem (still in 8.5a0) is that [socket -async] still does the hostname -> IP address synchronously. Which I've known about for ages, but it is really hard to fix. The problem is that the OS interface for doing the mapping is itself purely synchronous and a completely monolithic mess. Working around that requires a helper process or thread, and hence the whole thing is rather complex to fix. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=824251&group_id=10894 |