File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Tests/Runtime/Transports Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,7 +164,12 @@ public IEnumerator ConnectSingleClient_Hostname()
164164 Assert . AreNotEqual ( NetworkFamily . Invalid , endpoint . Family ,
165165 "Timed out waiting for localhost hostname resolution to complete." ) ;
166166
167- m_Server . SetConnectionData ( endpoint . Address , 7777 , endpoint . Address ) ;
167+ // Use the wildcard listen address for the resolved address family. This handles
168+ // cases where "localhost" resolves to a non-loopback address (e.g. a device's LAN
169+ // IP on some Android versions) and avoids relying on the exact IP in the local
170+ // endpoint (which may be a wildcard 0.0.0.0 when UTP binds before routing).
171+ var listenAddress = endpoint . Family == NetworkFamily . Ipv6 ? "::" : "0.0.0.0" ;
172+ m_Server . SetConnectionData ( listenAddress , 7777 , listenAddress ) ;
168173 m_Server . StartServer ( ) ;
169174
170175 yield return WaitForNetworkEvent ( NetworkEvent . Connect , m_ClientsEvents [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments