SoftwareGuy / Ignorance

Ignorance utilizes the power of ENet to provide a reliable UDP networking transport for Mirror Networking.
Other
248 stars 31 forks source link

iOS Server doesn't work #51

Closed mikosaure closed 4 years ago

mikosaure commented 5 years ago

The server doesn't work on iOS (no matter the version) with Unity 2018.3.11f1 and XCode 10.2.1.

If I run the Mirror example Basic, click LAN Server Only then try to connect from another device, nothing happens. It works fine when I do the exact same thing with an Android device or with Unity Editor.

SoftwareGuy commented 5 years ago

This might be something to do with listening addresses on iOS (had this issue before on OS X Editor and Standalone). Do you have "Bind to all interfaces" ticked?

SoftwareGuy commented 5 years ago

Just tried this on an iPhone 4S connected via WiFi and a Unity Editor instance on my Macbook Pro, but that looks like it was just a fluke because it doesn't want to connect again...

SoftwareGuy commented 5 years ago

Some weirdness was happening but I was able to get 5 out of 5 attempts of having the iPhone 4S as the host and the editor connecting to it in a row. Then Xcode started saying it randomly timed out waiting for the app to start which seemed to be cured after I unplugged the phone and replugged it.

Then I tried again on the iPhone as the host and the Editor seemed to not want to connect, so I minimized the app, stopped the Editor trying to connect, then resumed the app and pointed the Editor to the phone... boom, it connected.

Apparently something in the Xcode Editor I spotted said that iOS kills any open sockets when applications are put into background mode. But I am not sure about that.

Seems to be random.

If you could, could you try the commit that I just added into master branch of Ignorance? That would be appreciated.

mikosaure commented 5 years ago

Hey! Good news, I just tried the commit and looks like it's working now! We are going to do more tests but so far so good.

SoftwareGuy commented 5 years ago

Alright, please let me know how your tests go.

SoftwareGuy commented 4 years ago

Closing this due to lack of communication over extended period of time; reopen if required.