Handling errors

Options
Hello,

I successfully implemented multiplayer in my game (thanks for your great library!), but I'm not able to implement error cases.

I'm trying the simple case where user is not connected to the internet.
I'm getting an exception but from PUN's core instead of my own code (see below), so I have no idea how to handle it.

This is the exception:
DNS.GetHostEntry() failed for: ns.exitgames.com. Exception: System.Net.Sockets.SocketException (0x80004005): Could not resolve host 'ns.exitgames.com'
  at System.Net.Dns.Error_11001 (System.String hostName) [0x00015] in <ae22a4e8f83c41d69684ae7f557133d9>:0 
  at System.Net.Dns.GetHostByName (System.String hostName) [0x00021] in <ae22a4e8f83c41d69684ae7f557133d9>:0 
  at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00052] in <ae22a4e8f83c41d69684ae7f557133d9>:0 
  at ExitGames.Client.Photon.IPhotonSocket.GetIpAddresses (System.String hostname) [0x00029] in <11e9abbca912444aa80ed58a280369fc>:0 
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Libs/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2304)
ExitGames.Client.Photon.<>c__DisplayClass108_0:<EnqueueDebugReturn>b__0()
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
Photon.Pun.PhotonHandler:Dispatch() (at Assets/Libs/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:205)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Libs/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:139)

Can you please help me or give me a piece of documentation?
I googled everywhere but weirdly didn't find anything useful.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Flex42,

    Thank you for choosing Photon and for your kind words!

    Maybe the machine where you run this on cannot resolve our nameserver.
    if you do "nslookup ns.exitgames.com" on a cmd or PowerShell do you get a result back?
    if not maybe set the DNS server to 1.1.1.1 or 8.8.8.8 or 8.8.4.4.

    What PUN version are you using?
    What Unity version are you using?
    What target platform is this?
    Does it happen in the Editor or only in a build client?
    What Scripting Backend? Mono/.NET version?

    Did you try building & connecting from demo scenes?
    Did you try another Unity version?
    Did you try another network?
    Did you try building on another machine?
    Did you try the build on another machine?