Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

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.

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, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

HoloToolkit Sharing - How can I create persistent session from client?

Hi,
I'm creating HoloToolkit Sharing Service session from C# console application.

Following is the Main function code:

using (XToolsApp xToolsApp = new XToolsApp())
{
Timer timer = new Timer(60);
timer.Elapsed += (source, e) => { xToolsApp.Update(); };
timer.Start();

            NetworkConnectionData networkConnectionData = new NetworkConnectionData(xToolsApp)
            {
                UserName = "TEST_USER",
                ServerAddress = "localhost:20602",
                ViewerAddress = "localhost:20603"
            };
            xToolsApp.SessionManagerListener.SessionAdded += (session) =>
            {
                if (session.GetName().GetString().Equals("Default", StringComparison.OrdinalIgnoreCase))
                {
                    xToolsApp.CreateSession("TEST_SESSION", SessionType.PERSISTENT);
                }
            };
    Console.ReadLine();
        }

In above code, the statement "xToolsApp.CreateSession("TEST_SESSION", SessionType.PERSISTENT);" calls the following function.

public bool CreateSession(string sessionName, SessionType sessionType)
{
XString nameXString = new XString(sessionName);
LogWriteLine("Creating Session " + sessionName);
if (!this.SessionManager.CreateSession(nameXString, sessionType))
{
LogWriteLine("Failed to request a new session!");
return false;
}
return true;
}

Further, in above code, the statement "this.SessionManager.CreateSession(nameXString, sessionType)" calls the following function, part of HoloToolkit.Sharing namespace's auto generated SessionManager.cs class

public virtual bool CreateSession(XString sessionName, SessionType type) {
bool ret = SharingClientPINVOKE.SessionManager_CreateSession__SWIG_1(swigCPtr, XString.getCPtr(sessionName), (int)type);
return ret;
}

But it is still creating ADHOC session (not PERSISTENT). What should I do to create PERSISTENT session?

Answers

  • Options

    @GurpreetSingh,
    Have you filed an issue in the HoloToolkit-Unity GitHub repository? I highly recommend reporting issues there so the community working on the HoloToolkit is directly made aware of and address the problems you are seeing.

    Thanks!
    David

Sign In or Register to comment.