Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: phoenix on November 18, 2015, 02:00:34 AM
-
I am receiving this error when I try to stop a game server.
NotSupportedException: /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Threading/Thread.cpp(367) : 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."
at TNet.GameServer.Stop () [0x00000] in <filename unknown>:0
at TNServerInstance.Disconnect () [0x00000] in <filename unknown>:0
Accoring to this post, it looks like unity is not going to support Thread.Abort
http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-16
And according to this post maybe we can call interrupt instead?
http://stackoverflow.com/questions/3632149/question-about-terminating-a-thread-cleanly-in-net/3632642#3632642
Any suggestions on stopping a game server for ios il2cpp?
-
That's such a silly decision on their end... ok, they don't want to support the function, fine.. why not make it default to calling Interrupt() then? Boggles my mind...
I would say change it to Interrupt() and see if it works as expected. I went through and simply did:
#if UNITY_IPHONE
mThread.Interrupt();
#else
mThread.Abort();
#endif
-
I managed to open bug report on this. You can vote here:
https://issuetracker.unity3d.com/issues/il2cpp-notsupportedexception-is-thrown-when-calling-socket-dot-dispose-from-httplistener
Context:
http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-47#post-2392651
-
Sorry for the revisit here but needing to finish and release a product before updating to later Unitys and TNet 3, and this one's bit me in the butt. Where exactly do I make the above code changes (Using TNet 2) to enable server termination on il2cpp? Thanks
-
If you press Ctrl+F while Visual Studio (or whatever IDE you use) has focus, it'll bring up a search button. You can adjust the search options to search through the entire solution. From there, the search term I chose was ".Abort();". I came up with 4 results:
TNTcpLobbyServer.cs - Stop() function
TNUPnP.cs - Close() function
TNGameServer.cs - Stop() function
TNUdpLobbyServer.cs - Stop() function
-
That's sensible. I hadn't thought that I need to replace all instances of Abort().