Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnection when quitting and changing the app #55

Open
FOKSlab opened this issue Mar 9, 2021 · 4 comments
Open

Disconnection when quitting and changing the app #55

FOKSlab opened this issue Mar 9, 2021 · 4 comments

Comments

@FOKSlab
Copy link

FOKSlab commented Mar 9, 2021

Hi, I tried Reality Mixer on my iPad Pro and it works on some apps but when I quit an app and launch another one network connection is broken. Is this forecasted to do something about this ? Is this an issue on the Reality Mixer side or on the app side (the app may stay connected in the background) ?
It would be great to make available the auto disconnection/reconnection behaviour (deleting the current connection if no data is received and trying to reconnect next)

@fabio914
Copy link
Owner

You'll have to go to the Reality Mixer app and disconnect before launching the next game, you can then connect again once the other game has finished loading.

@FOKSlab
Copy link
Author

FOKSlab commented Mar 12, 2021 via email

@jonathanperret
Copy link
Contributor

Hi, Thanks for your answer. I already found this process but I was wondering if is there a way to auto-connect Reality Mixer app when detecting a compatible MRC app on Quest and disconnect when app is not running any more ? It would be a great feature to add in your software if possible so iPad can be used to get a "Chromecast-MRC-like" feedback of what the user is doing in the headset.

That would be nice indeed. But an issue is that because the MRC server process is actually part of each Quest app, when the Quest app exits, if there is an established connection it is closed from the server (Quest) side, causing the Quest-side socket to enter the TIME_WAIT state (see http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html for a good explanation of the issue).

That TIME_WAIT socket unfortunately prevents the next started Quest app from starting its own MRC server on the same port. This is why you occasionally end up with a Quest app that supports MRC but that you can't connect to using RealityMixer (or any other MRC client): the app couldn't initialize its MRC listener because the port was busy with a "dead" socket. This can be cleared up by restarting the Quest (hence the "When in doubt, reboot" advice on https://developer.oculus.com/learn/mixed-reality-technical-and-trailer-video/), but waiting a few minutes for the TIME_WAIT socket to go away and restarting the Quest app would work just as well (if you have developer mode enabled on the Quest you can check if a lingering socket exists by running adb shell "netstat -ant|grep 28734").

There are ways to work around this TIME_WAIT issue but unfortunately all of them would require a modification on the Quest side, and even worse, the listening socket is created by a library that is part of the Quest OS so even the cooperation of Quest app devs would not be sufficient.

So as far as I can see, we're stuck with having to manually disconnect RealityMixer before quitting a Quest app (remember that the TIME_WAIT state does not occur if the client initiates the disconnection), if we want to be able to reconnect to the next Quest app without waiting or rebooting. Hence I think modifying RealityMixer to auto-reconnect would not be very convenient — in practice you'd have to reboot the Quest everytime you change apps.

I'd love to be proven wrong though — or for Oculus to change the MRC lib in the OS to use SO_REUSEADDR so it (hopefully) wouldn't be vulnerable to that TIME_WAIT issue!

@FOKSlab
Copy link
Author

FOKSlab commented Mar 13, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants