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.

Client-Server Socket Connection between HoloLens and PC?

edited December 2018 in Questions And Answers

I am trying to develop two different applications that can exchange data using sockets. The PC is the Server, whereas the HoloLens is the Client. I have been able to develop them using Unity3D for both applications and the LiteNetLib library.(https://github.com/RevenantX/LiteNetLib). Now I would like to achieve the same result without using the LiteNetLib library. I tried with System.Net.Sockets (https://docs.microsoft.com/it-it/dotnet/framework/network-programming/asynchronous-client-socket-example) but it does not compile. Did anyone try to make socket connections using c# libraries? Moreover, did anyone try to make a socket connection between a HoloLens Client and a Java Server?
Thank you in advance :)



  • It's a little old now but I wrote a simple example of communication between a desktop (i.e. 2D XAML UI) app and a HoloLens app (i.e. 3D Unity UI) here on my site a while ago.

    If I remember right, this tries to take an "automatic" approach to connecting the socket client to the socket server by advertising the details of the server over bluetooth so that the client can just 'magically' find it. If you don't want those pieces (or any other pieces) you should be able to just remove them. This code looks to be using Windows.Networking.Sockets to function.

    I hope that helps :smile:

  • Hi @FraDepa were you able to find a way to make it?I m working on a same trouble, everything works fine if I deploy it on my pc but when I deploy it on the hololens I can t receive messages from the server (simple nodejs script).Thanks in advance!!

  • Hi @ChiaraPalu, no... I used the LiteNetLib library for both the PC and the HoloLens.
    I remember that the client socket (on HoloLens with LiteNetLib) and the server socket (on the PC using JAVA) could not connect because the server expected the packets in a format type that was not supported by default on Java.
    I hope it could help

  • Thanks @Depa91 I actually switched to a TCP protocol using windows.networking.socket with streamsocket. Everything worked fine without any issues! I was having trouble with udp (datagram) protocols, Hololens has some problem with firewall. Thanks for your answare!

Sign In or Register to comment.