I have created a Unity application that uses System.Net.Sockets for TCP communication with a separate server computer. This application works flawlessly in the editor, and when built for Android or PC. But when I tried to create an iOS build (on a MacBook) the app loads correctly, but no network communication is made.
Next I created a developer build, but no errors or warnings appeared during runtime, it just didn't connect to the server. I made sure to double check that they were both on the same network, and that the ports are set correctly.
I am currently debugging and looking through documentation, but I haven't seen anything stating that System.Net.Sockets is incompatible with iOS. Once the following questions are answered I can upload code snippets / ask a new question about the specific code.
Does Unity support System.Net.Sockets for iOS? Is there something unique that needs to be done when building a networked project for iOS?
Thank you for your time and assistance!
A quick pathetic answer:
Whether or not System.Net.Sockets in Unity works in iOS / Android builds is one of the great mysteries of the ages, and the answer changes every few months :/
I am almost certain it is currently possible ...
For example, notice this popular library https://assetstore.unity.com/packages/tools/network/best-http-2-155981 which works perfectly with ios/droid, and indeed is ultimately just .Net underneath.
(A worthwhile tip is, get on the forum of that library and pose your problem...)
For example, notice this "detailed information" :-/ http://answers.unity.com/answers/1329285/view.html
Notice these comments for instance Unity socket project don't work when installed to iPhone and https://forum.unity.com/threads/unity-ios-xcode-socket-related-linker-errors-quite-stuck.518162/
TBS, System.Net.Sockets absolutely works in Mac or PC desktop builds (we do that daily)
As discussed, in practice it's all-but impossible to use System.Net.Sockets from scratch anyway; it's an incredible amount of work, realistically https://github.com/Marfusios/websocket-client is the universal choice today in Unity. You'd have to do that anyway .. and see if it works in iOS/droid :/
Problems ...
Be aware that using realtime messaging in a frame-based ECS system ....... is really confusing. Notice use of queue explained here https://gamedev.stackexchange.com/a/169413/86883
For that matter anything frame-based is incredibly confusing when combined with realtime information of any type. Famous Thermometer Example: https://stackoverflow.com/a/54184457/294884