Using IPv6 with StreamingSocket as listening socket

#1

When using a StreamSocket in listener (accept) mode (using createListener()) we’re limited to IPv4. Is there any chance this might change in the near future so we can use StreamingSocket in listen mode using IPv6?

I think the change wouldn’t even be that big, as most of the IPv6 support is there already. Looking at the code I think createListener should use AF_UNSPEC to allow both IPv4 & IPv6 (or make it a function argument) and bindSocket would have to use getAddressInfo to find the interface to bind (where 0.0.0.0 & “::” translate to all interfaces).

If you would be interested I’m happy to create a diff with proposed changes.

0 Likes