We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.
On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.
So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.
SharingService events aren't invoked?
Academy 240 uses the Sharing Service, but assumes you connect on awake, and never disconnect. I want to have control over joining and leaving server/session/room, but it seems to be quite difficult with the existing Sharing Service. I wanted to share some of the problems I've run into, and see if I might be going about all of this in the wrong way.
There doesn't seem to be a clear distinction between the "server" which is where SharingService is running, and "Session List Server", which handles session connections. I eventually realized that the ServerSessionsTracker.ServerConnected event refers to the Session List Server, and not the "server". However, I keep getting into a state where I am connected to the server, and ServerSessionsTracker.ServerConnected is invoked, and yet SharingStage.Manager.SharingManagerConnected isn't invoked. This latter event should be invoked when the SharingManager is created and connected, presumably after the SharingStage.Connect() method. For the Session List Server to be connected, the SharingManager should also be connected? At one point, I was even connected to the Session List Server while SharingStage.IsConnected was false.
When it comes to disconnecting, I tried calling SharingManager.GetServerConnection().Disconnect(), but I don't know which event I can handle upon actually disconnecting. I tried ServerSessionsTracker.ServerDisconnected as well as NetworkConnectionAdapter.DisconnectedCallback, but neither seem to work for me.
I also ran into problems trying to manually connect again after disconnecting, getting this error: Failed to create incoming connection on port 20608. Error code: 6. It's an error from RakNet when failing to bind a socket, and for now it seems to be fixed by setting config.SetProfilerEnabled(false) in SharingStage.Connect().
When manually trying to leave a room, I sometimes get an AccessViolationException even when RoomManager().GetCurrentRoom() is true.
Using the AutoJoinSession script works for joining the first time, but when I leave the session, it doesn't update the local sessions list. Then when trying to join a second time, it thinks the room already exists (since it exists locally), and only joins the local session instead of creating a new session on the server.
There's a lot here, but I'm curious if anyone's tried to separately control server/session/room, and run into any of these problems?