PUN2 with no Internet connection cause errors

Good day, guys.
I have the problem. When i use PhotonNetwork.ConnectUsingSettings(); with disabled Internet connection it causes 2 errors which i can't handle (try-catch doesn't work too):
Connect() to 'ns.exitgames.com' () failed: System.Net.Sockets.SocketException: Этот хост неизвестен.

at System.Net.Dns.GetHostByName (System.String hostName) [0x00000] in :0
at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00000] in :0
at ExitGames.Client.Photon.IPhotonSocket.GetIpAddress (System.String address) [0x00015] in C:\Dev\photon-sdk-dotnet\PhotonDotnet\IPhotonSocket.cs:270
at ExitGames.Client.Photon.SocketUdp.DnsAndConnect () [0x00004] in C:\Dev\photon-sdk-dotnet\PhotonDotnet\SocketUdp.cs:148
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1819)
ExitGames.Client.Photon.SocketUdp:DnsAndConnect() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/SocketUdp.cs:192

and
InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread
UnityEngine.Object.EnsureRunningOnMainThread () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:153)
UnityEngine.Object.GetInstanceID () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:73)
UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:182)
UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:140)
UnityEngine.Object.op_Inequality (UnityEngine.Object x, UnityEngine.Object y) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:403)
UnityEditor.AudioMixerWindow.OnPauseOrPlayModeStateChanged () (at C:/buildslave/unity/build/Editor/Mono/Audio/Mixer/GUI/AudioMixerWindow.cs:313)
UnityEditor.AudioMixerWindow.OnPauseStateChanged (PauseState state) (at C:/buildslave/unity/build/Editor/Mono/Audio/Mixer/GUI/AudioMixerWindow.cs:302)
UnityEditor.EditorApplication.Internal_PauseStateChanged (PauseState state) (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:282)
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1819)
ExitGames.Client.Photon.SocketUdp:DnsAndConnect() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/SocketUdp.cs:192)

Tested in Unity Editor 2018.2.14f1 on Windows 10 x64.
OnDisconnected() is not called.

How can i handle the case when a user doesn't have internet connection in PUN2?

Sorry, i'm a newbie in network stuff.

Comments

  • Tested on a build. No problems in it.

    So, the problem appears only in the editor
Sign In or Register to comment.