I ported an application to support IPv6, using popular tutorials. I decided to use only one socket listener for both protocols. Now I realized I have to set IPV6_V6ONL
It is fine either way.
If you bind v4 and v6 explicitly, you need to set IPV6_V6ONLY
, otherwise, you need to clear it. The default setting varies between platforms.
Some platforms do not support accepting v4 connections on v6 sockets, so for maximum compatibility I'd go with the "two sockets" approach.