nio channels with IPv6 on Windows XP

Mark Thornton mthornton at
Mon Dec 14 00:53:02 PST 2009

Alan Bateman wrote:
> Salter, Thomas A wrote:
>> It seems that AsynchronousServerSocketChannel does not work with IPv6 
>> sockets on Windows XP (the combination that invokes the TwoStack 
>> implementations).  Is this a known restriction or is it intended to 
>> work?  I can certainly understand why you might not want to support it.
>> I tested on b77.  My test runs on Windows 7 but fails on Windows XP.  
>> It fails on the bind because an IPv6 address is passed to AF_INET 
>> socket.
> As Chris said, you need Vista or newer because that's the first 
> release of Windows with the new stack that supports dual-stack sockets 
> (ie: interoperability with IPv4 and support for IPv4-mapped IPv6 
> addresses). The IPv6 stack that came in one of the Windows XP service 
> packs was a separate stack and lacks IPv4 interoperability.
> -Alan.
Unfortunately you then find that InterfaceAddress.getBroadcast() and 
InterfaceAddress.getNetworkPrefixLength() returns nonsense for IPv4 
addresses. The work around is to disable the IPv6 support ...

Mark Thornton

More information about the nio-dev mailing list