Closed zenorbi closed 1 year ago
Thanks for reporting. I'm pinging back to the feature team to investigate this issue.
Hi @zenorbi,
Unfortunately, I am unable to repro this issue on the latest BasicSample in this repo. Can you provide more details on what kind of error you are referring to before disconnecting?
Also, I am not sure how using "TryGetConnectionState" twice will hinder getting disconnecting reason. Could you please share some Unity Player Log for us to debug further?
Hi @satyapoojasama,
Thank you for looking into this. I cloned this repo and opened the RemotingSample
project in Unity 2020.3.43f1 as indicated by the ProjectVersion.txt. All I did is that I added Debug.Log($"DISCONNECT REASON: {disconnectReason}");
to this method: https://github.com/microsoft/OpenXR-Unity-MixedReality-Samples/blob/666f809b418b8c84fd17e5d00589708c014d76a6/SampleShared/Samples/AppRemoting/Scripts/AppRemotingSample.cs#L234
I then entered play mode and tried to connect to an unused IP address. The log I received was:
DISCONNECT REASON: None
I would expect a HandshakeUnreachable
, the same as what the AppRemotingSubsystem
receives.
Interestingly if I build this project, I never even receive an OnDisconnecting
callback in the player.
Thank you for providing the logs and details @zenorbi. I suspect you might have some misconceptions here. May I confirm your work flow? Are you using "Holographic Remoting for Play Mode" feature where you connect to the player app from Unity editor? In that case the OnDisconnecting() event will never be received. If you refer to the documentation of this feature here, it clearly states that this works only when "Holographic Remoting remote app" feature in OpenXR project settings is enabled. You may also refer to this documentation here to gain more clarity on Appremoting API behavior in different configurations.
@satyapoojasama Thank you for checking it. No I am not using "Holographic Remoting for Play Mode", I have left every setting as is defined in this project (using "Holographic Remoting remote app") and I am using the UGUI interface provided in the project to enter the IP address and all.
In our application this remoting used to work fine for many months and after a mixed reality upgrade where we had to switch over from checking the connection state every frame to the new event driven system, we have lost the DisconnectReason and the system always reports None as the reason.
Here is a video where I reproduce this issue on a fresh git clone:
Wonderful, thank you for the video. Looks like something might have regressed. Your set up looks right.
Hi @zenorbi, we are actively working on fixing the bug and will update you once the fix makes to the release. Thank you for finding this.
Hi @zenorbi , we fixed this issue and it will be available in the next release of our plugin. Thank you.
1.9 release is now out. Please update to get the fix for this bug.
We are using the
AppRemoting.StartConnectingToPlayer
to connect Unity to Hololens but when there is an error theAppRemoting.Disconnecting
always reportsDisconnectReason.None
.I believe the issue is that
AppRemotingSubsystem.OnSessionLossPending
callsTryGetConnectionState
and thus "consumes" the disconnect reason, so when later theAppRemotingSubsystem.ConnectRoutine
callsTryGetConnectionState
it doesn't get the reason.I have verified this with a debugger. The
AppRemotingSubsystem.OnSessionLossPending
does get the correct disconnect reason.