(Case 1390358) IPv6.Any bound NetworkDriver cannot accept connection from IPv4 endpoint

Hi. As a title said, IPv6 bound NetworkDriver cannot accept connection from IPv4 endpoint.

This is clearly different behaviour to legacy LLAPI. With LLAPI, IPv6.Any bound NetworkTransport can accept connection from IPv4 endpoint without any problems.

Reported as Case 1390358.

I’d argue that it’s the LLAPI behavior that is wrong here, but I understand how this might be seen as a regression. Nonetheless, we don’t intend to emulate this behavior in Unity Transport.

A driver can only bind to a single address (of a single family). It should be seen as thin abstraction over a socket (which is what it really is), and sockets can’t bind to multiple addresses. If one wants to accept connections for both IPv4 and IPv6, using two drivers is how it should be done.

1 Like

I resolved this by implementing two drivers in my code. Thanks for reply.

Small feedbacks:
I implemented internal socket map by using Dictionary<NetworkConnection, MyOtherClass>, but NetworkConnection does not implement IEquatable so it makes unneeded GC. I think it can be easily resolved by adding IEquatable to NetworkConnection.

I created new post about this: