hololenswindows-mixed-realityhololens-emulator

How to connect HoloLens 2 Emulator with a local UDP Sender


Maybe anyone can help me with this problem. I have a UDP-Sender console application, which should send udp packages to a UWP application for HoloLens2 made with unity 2019.3.4. While beeing in the Unity Editor the App receives all packages sent from the console application correctly. However, if I build the solution with Visual Studio and deploy it successful on the Hololens Emulator (V. 10.0.18362....) the application receives no data. Earlier, when I connected the Hololens2 via usb with my computer the application running on the HoloLens2-device received the data correctly but for the moment I am forced to use the emulator. Everything has to work in my local network without internet access. Is there a way to set up a udp connection to the Emulator via localhost?


Solution

  • I finally figured out what the problem might be. I used Datagram Socket to set up the connection between the app and the Emulator Project. In the Microsoft Documentation as well as in this unity question they mention that Datagram-Sockets can´t set up connections to localHost. Since I can successfully bind my socket and just don´t receive data I guess this is the problem. I will try to use the UWP share contract instead.

    https://learn.microsoft.com/en-us/windows/uwp/networking/sockets https://forum.unity.com/threads/uwp-for-wmr-datagramsocket-not-receiving-udp-data.586147/