Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

iPhone 4 connect to server issue

Discussion in 'iOS and tvOS' started by Permantier, May 20, 2015.

  1. Permantier

    Permantier

    Joined:
    May 13, 2015
    Posts:
    5
    Hello,

    I have an issue with connecting to server for the iPhone 4. I tried 10 times with 2 different phones. It succeeded 7 times and failed 3 times. I use Unity 5.0.2 and Xcode 6.3.1

    These are the errors I get:

    1: The descriptor is not a socket

    2: NotSupportedException: /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Threading/Thread.cpp(355) : Unsupported internal call for IL2CPP:Thread::Abort_internal - "Thread abortion is currently not implemented on IL2CPP; it is recommended to use safer mechanisms to terminate threads."

    How can I fix this? Thank you for your help.
     
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Are you doing your own threading here or is that some under-the-hood threading going on with Unity+IL2CPP?

    Can you show the code you're using? (in code blocks please)
     
  3. Permantier

    Permantier

    Joined:
    May 13, 2015
    Posts:
    5
    This is the source code:

    _socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );

    _socket.NoDelay = false;
    IPHostEntry iphost = Dns.GetHostEntry( _strIP );
    IAsyncResult result = _socket.BeginConnect( iphost.AddressList[0], _iPort, null, null );

    bool success = result.AsyncWaitHandle.WaitOne( 5000, false);
    // May be this code - Case “Not SupportedException”

    if ( !success ){
    _socket.Close();

    _socket = null;
    return;
    }

    Thanks for your help
     
  4. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Could you please submit a bug report and attach small reproduction project to it? Thanks :)