0

On a windows 7 machine, I have set IPV6_V6ONLY to 0 in order to allow for dual stack sockets. All the examples of dual stack sockets I have seen on the web bind to the ANY address (0.0.0.0). Binding on this address, I can confirm that I can connect using an ip4 address or an ipv6 address.

However, if I try and bind to any address other than the ANY address, say loopback (i.e. [::1]), on a dual stack socket, I find I can only connect to that socket using an ipv6 address -- that is I can connect on [::1], but not on 127.0.0.1.

Is this expected behavior? I cannot seem to find anything definitive on the web (including on the stackoverflow sites). Is there something different I need to be doing?

Thanks!

MadHatter
  • 79,770
  • 20
  • 184
  • 232

1 Answers1

3

Yes: if you bind to the ANY address with IPV6_V6ONLY set to 0 then both IPv4 and IPv6 can be used. If you bind to a specific address then only that address (and therefore its address family) can be used.

Sander Steffann
  • 7,712
  • 19
  • 29