ATL Server and IIS 7/Vista IPv6RSS

3 replies

Last post Mar 12, 2008 07:17 PM by ryan.b

  • ATL Server and IIS 7/Vista IPv6

    Sep 19, 2007 03:58 PM|InvaderZim|LINK

    Howdy! 

    I have an ISAPI extension based on ATL server.  When I issue a request against the application on Vista like this:

     

       http://localhost/myapp/default.srf

     

    the request hangs. 

     

    On a hunch, I thought that this might be related to Vista/IIS7's IPv6 support, so I edited the C:\Windows\System32\drivers\etc\hosts file and defined 'localhost' as 127.0.0.1.  I also had to comment out the ::1 line, as I read elsewhere that Vista prefers IPv6 to IPv4 if both are defined:

     

      127.0.0.1       localhost

       # ::1             localhost   

     

    Lo and behold, the application ran fine.  It also ran fine before this change if I requested http://127.0.0.1 rather than http://localhost.

     

    I haven't yet delved into the guts of ATL Server to see what's upsetting it, but before I do, I figured I'd ask if this is a known problem and may have been addressed in a possible ATL server update in Visual Studio 2008.

     

    Thanks in advance...

     

    --- Uwe

    IIS7 ISAPI ISAPI Extension IPv6 ATL Server

  • Re: ATL Server and IIS 7/Vista IPv6

    Sep 19, 2007 04:25 PM|iiscool|LINK

    This is definitely not a problem with ATL nor with your ISAPI extension.

    The 127.0.0.1 <--> localhost mapping is supposed to be there in the hosts file. That is the way your machine resolves the name "localhost" to a real IP (127.0.0.1).

  • Re: ATL Server and IIS 7/Vista IPv6

    Sep 19, 2007 04:49 PM|InvaderZim|LINK

    Thanks for replying.  The problem isn't the mapping of localhost to 127.0.0.1; the problem is the mapping of localhost to ::1, which I gather is the IPv6 loopback address.

    I just checked the hosts file on a virgin Vista Business machine, and after the comments, it contains two lines:

    127.0.0.1    localhost
    ::1              localhost

    My understanding is that, for conflicts, Vista prefers IPv6 over IPv4, so unless the second 'hosts' line above is commented out, http://localhost/myapp/default.srf resolves to http://::1/myapp/default.srf and that causes my ATL server-based application to hang if invoked from the same machine. 

    So my assumption is that there is some difference in the ISAPI interface when it's called using an IPv6 address, rather than an IPv4 address.  I can't imagine why else it would hang.

    In any case, if this isn't a known problem, I'll see if I can figure it out.  It would still be nice to know if there will be an updated ATL server.

    --- Uwe

  • Re: ATL Server and IIS 7/Vista IPv6

    Mar 12, 2008 07:17 PM|ryan.b|LINK

    You may have to specifically target Windows Vista when building your projects...

    for example, most of the atl server project files automatically generated in VC++.net #define windows nt 4.0, which is incompatible with some of the newer Winsock.h files...

    All of my atl server apps run fine on windows server 2008.

    -RB