This PR fixes the IPv6 support properly. The two previous PRs, #123 and #126, both made a mess out of it:
PR #123 implemented IPv6 by breaking non-dualstack IPv4 support.
PR #126 fixed IPv4 support by breaking non-dualstack IPv6 support.
This change fixes the mess entirely. IPv4, IPv6 and IPv6-dual-stack are now all independently supported and work as expected.
Namely IPv4 can't receive IPv6, IPv6 can only receive IPv4 if NetPeerConfiguration.DualStack is set. You can still have an IPv6-only socket.
I'll leave some review comments on the PR for less-immediately obvious changes.
This PR fixes the IPv6 support properly. The two previous PRs, #123 and #126, both made a mess out of it:
PR #123 implemented IPv6 by breaking non-dualstack IPv4 support. PR #126 fixed IPv4 support by breaking non-dualstack IPv6 support.
This change fixes the mess entirely. IPv4, IPv6 and IPv6-dual-stack are now all independently supported and work as expected. Namely IPv4 can't receive IPv6, IPv6 can only receive IPv4 if NetPeerConfiguration.DualStack is set. You can still have an IPv6-only socket.
I'll leave some review comments on the PR for less-immediately obvious changes.
cc @CallumDev @Badartefact