According to RFC 3493 the socket option IPV6_V6ONLY should be off by default, see https://tools.ietf.org/html/rfc3493#page-22 (chapter 5.3). However this does not seem to be the case on all systems. For instance on any Windows OS, the option is on by default. Therefore clear this option in order to allow an server socket which can support IPv6 and IPv4 at the same time.