CUDLR crashing on start, some iOS devices
tenpn opened this issue · comments
Check out the SocketException below. This happens to one of our (remote) testers when they boot the game either on an iPad 1 (iOS 5.0.1) or iPod 4th Gen (iOS 6.1.3). On my 4S (iOS 7.0.3) I found I got the same crash if I was on 3G instead of wifi.
(Filename: /Applications/buildAgent/work/ea95e74f6e5f192d/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 54)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1](Filename: Line: -1)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1]
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] LevelLoader:Update()
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] UnityEngine.Object:Instantiate(Object)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] UnityEngine.Object:Internal_CloneSingle(Object)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at ServerInfo.Awake () [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at System.Net.Dns.GetHostByName (System.String hostName) [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at System.Net.Dns.hostent_to_IPHostEntry (System.String h_name, System.String[] h_aliases, System.String[] h_addrlist) [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] SocketException: No such host is known
2013-11-15 23:39:10 +0000 tripletown SocketException: No such host is known
at System.Net.Dns.hostent_to_IPHostEntry (System.String h_name, System.String[] h_aliases, System.String[] h_addrlist) [0x00000] in :0
at System.Net.Dns.GetHostByName (System.String hostName) [0x00000] in :0
at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00000] in :0
at ServerInfo.Awake () [0x00000] in :0
UnityEngine.Object:Internal_CloneSingle(Object)
UnityEngine.Object:Instantiate(Object)
LevelLoader:Update()
Thanks, I'll add some additional error handling to the startup. It looks like those machines can't resolve the hostname you're using.
Aw fuck, ServerInfo.Awake() is actually my code - I'm trying to fetch the IP to display it on screen, to make connecting to CUDLR easier for QA. Here's what I'm doing:
var host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
m_ipAddress = ip.ToString();
break;
}
}
This isn't cudlr's fault, so feel free to close this. But if you know a better way to fetch this info, maybe direct from CUDLR, let me know.
Ah, that's a nice feature.
Maybe try:
var ipaddress = Network.player.ipAddress;
From the docs:
https://docs.unity3d.com/Documentation/ScriptReference/NetworkPlayer-ipAddress.html
https://docs.unity3d.com/Documentation/ScriptReference/Network.html