id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8503,Cannot connect to localhost without global connectivity,Edward@…,chris_kohlhoff,"On Windows, if there are no network cards installed or they are all disabled, attempts to resolve localhost fail. The problem is that by default, the default value for the basic_resolver_query constructor's resolve_flags parameter is address_configured, which is AI_ADDRCONFIG on Windows. However, as implemented AI_ADDRCONFIG is actually detrimental, particularly for resolution of loopback and link-local addresses. The rationale from the Google Chrome source code explains this. Here is the relevant snippet from !SystemHostResolverCall in [http://src.chromium.org/viewvc/chrome/trunk/src/net/dns/host_resolver_proc.cc host_resolver_proc.cc]: {{{ #if defined(OS_WIN) // DO NOT USE AI_ADDRCONFIG ON WINDOWS. // // The following comment in is the best documentation I found // on AI_ADDRCONFIG for Windows: // Flags used in ""hints"" argument to getaddrinfo() // - AI_ADDRCONFIG is supported starting with Vista // - default is AI_ADDRCONFIG ON whether the flag is set or not // because the performance penalty in not having ADDRCONFIG in // the multi-protocol stack environment is severe; // this defaulting may be disabled by specifying the AI_ALL flag, // in that case AI_ADDRCONFIG must be EXPLICITLY specified to // enable ADDRCONFIG behavior // // Not only is AI_ADDRCONFIG unnecessary, but it can be harmful. If the // computer is not connected to a network, AI_ADDRCONFIG causes getaddrinfo // to fail with WSANO_DATA (11004) for ""localhost"", probably because of the // following note on AI_ADDRCONFIG in the MSDN getaddrinfo page: // The IPv4 or IPv6 loopback address is not considered a valid global // address. // See http://crbug.com/5234. // // OpenBSD does not support it, either. hints.ai_flags = 0; #else hints.ai_flags = AI_ADDRCONFIG; #endif }}} The developers of [http://xcb.freedesktop.org/ XCB] arrived at a similar conclusion. See their discussion on [http://thread.gmane.org/gmane.comp.freedesktop.xcb/6973 Bug: Can’t connect to localhost without global connectivity]. Code using ASIO can work around this problem, but doing so would require platform-specific code and intricate knowledge of poorly documented platform-specific behavior.",Bugs,closed,To Be Determined,asio,Boost 1.53.0,Problem,invalid,localhost AI_ADDRCONFIG,