ExceptionOnConnect

Options
Claytonious
edited December 2013 in DotNet
Using Unity3D (but with the "plain" SDK, not PUN), with Photon Cloud, against app-us.exitgamescloud.com:5055, after calling my LoadBalancingClient's ConnectClient() method, then:

* On the desktop, everything works - connect fine
* When deployed to an IPad, the same code (same app id, same URL, same code, etc.) ends up with a status of ExceptionOnConnect and fails to connect. The overridden OnStatusChanged on our is called and passed a value of StatusCode.ExceptionOnConnect.

What does ExceptionOnConnect mean? Why am I getting this only on the iPad and not on a desktop build of the same codebase? The iPad *definitely* has a good WIFI connection and is having no trouble reaching other sites and services. It can even browse to us.exitgamescloud.com, which presents us with a IIS screenshot.

Any ideas why we cannot connect from iPad but can from a desktop build?

Thanks!

Comments

  • Tobias
    Options
    The error means that the game couldn't connect to our server for some reason. So connection was never established at all.
    I would like to see the log from the client. You can grab it from the device easily with the "Organizer" in XCode. Maybe it has some important hints what goes wrong.

    Which Photon Unity SDK version are you running? The latest from our download page? Which Unity version?
    In any case: I think we will find a solution. It worked before and there's no reason it shouldn't.
  • The console output from the device is uninteresting - mostly output from our app, not Photon, but I've included it below anyway for your reference.

    This is Unity 4.3 Release Candidate 1, but same problem with Unity 4.2.x. Yes, this is the latest Photon SDK download, but as I mentioned here in another thread, it's possible we're not using the right DLL.

    This seems like such a basic failure - guess I will try it again in a minimalist project to see if it reproduces that way.

    iOS Device Output:
    -> applicationDidFinishLaunching()
    -> applicationDidBecomeActive()
    Renderer: PowerVR SGX 543
    Vendor: Imagination Technologies
    Version: OpenGL ES 2.0 IMGSGX543-97
    GL_OES_depth_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_IMG_read_format GL_IMG_texture_compression_pvrtc
    Creating OpenGLES2.0 graphics device
    Initialize engine version: 4.3.1f1 (cebd4d9b5122)
    Begin MonoManager ReloadAssembly
    - Completed reload, in 0.156 seconds
    Screen is [2048,1536]

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Orientation = [LandscapeRight]

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    OpenKit:Unity:Info OpenKit configured with endpoint: http://api.openkit.io
    PlaybackManager on PageReplays

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Transition to page Splash

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Transition to page SoloOrOnline

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Redirecting to CreateGame

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Auth?

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    OKManager.IsCurrentUserAuthenticated() = True

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Already authed

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Transition to page CreateGame

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Network status changed to ExceptionOnConnect

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Exception on connection level. Is the server running? Is the address (app-us.exitgamescloud.com:5055) reachable?

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)

    Network status changed to Disconnect

    (Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)
  • Found the issue - you have to use a stripping level of "Strip Assemblies" or higher when you build to iOS with Photon. (Photon is trying to use some of the overloads of Socket's constructor that require ConfigurationHost, and most of that was getting stripped out with our more aggressive "strip bytecode" setting.)

    This needs to be front-and-center in bold text at the top of the docs and readme.

    Thanks!
  • Tobias
    Options
    > Photon is trying to use some of the overloads of Socket's constructor that require ConfigurationHost, and most of that was getting stripped out with our more aggressive "strip bytecode" setting.

    I simply wasn't aware that "Strip Assemblies" will break the build. A while ago, I got told to use "Strip Bytecode" and didn't touch this setting again.
    I will put this hint into the readme and into the iOS section of the readme.


    Is the "Already authed" related to Photon or some other authorization?
  • The "Already authed" was something else - not related to Photon at all.

    And here's an important update on this issue: it was not the "Strip Assemblies" setting, after all. It was the "Dot Net 2.0 Subset" option that fixed it. So, here is the actual issue:

    1. If you build to iOS from Unity with "Dot Net 2.0" API setting, then you will get this error (ExceptionOnConnect due to Socket constructor).
    2. You must change it to "Dot Net 2.0 Subset" in order to fix the problem.

    (I had inadvertantly changed both that and also the stripping level at the same time, which is why I mistakenly thought the stripping level was the fix).

    This is going to a serious roadblock for anyone who needs the full 2.0 API, though. We are able to use the subset for now, but there will be some projects for whom this is not a workable solution. I highly recommend that you guys use a different overload of the Socket constructor, or possibly do something else, to fix this issue for Unity users.

    Thanks!
  • Tobias
    Options
    As it's not a compile issue, I think we (you) should send this as bug report to Unity. Obviously the Subset and Full API are compatible but behave differently. That can't be the idea of the Subset, or could it?

    Anyways: As this is an issue, we can take a quick look at the full api and maybe we can work around the exception, too.
    Thanks for the analysis.