I have a DLL that uses Multicast to find other devices on the network. It works on every platform (IOS/Android/Windows/OSX/Linux/etc.) I am trying to get it to work on the Hololens. I currently use the broadcast address of 224.0.0.24. When using the Emulator, I use an Emulator Virtual Switch to obtain an IP address on the correct network for the Hololens.
I also checked the “PrivateNetworkClientServer” capability before building the Visual Studio project.
Does anyone know if this will work or how to get it to work?
What exactly doesn’t work? Runtime failure? Fails to build in the first place?
If I had to guess based on the limited information provided, you might just need to go into the Build Settings > Player Settings… and change from .NET to IL2CPP.
Everything compiles and runs. It also calls the sendto() function properly, I could post the code that creates the socket (which uses socket(), and setsockopt for SO_REUSEADDR, SO_RCVBUF, IP_MULTICAST_TTL, IP_ADD_MEMBERSHIP). I also create a socket for receiving messages from the Multicast port. But this code seems to be correct, since it works on all different platforms. The behavior is simply that I messages do not get sent or received on the multicast port. I have a feeling that it has something to do with the network configuration/firewall. For example, by default, Hololenses do not respond to ping requests. This is a firewall setting that can easily be changed in other OSes, and hopefully I can get Multicast to work on Hololenses?
Also, it could be something to do with UWP and adding to the DLL’s manifest (embedded?) so that it can use networking capabilities. But I am unsure, and if anyone out there has experience, please let me know.
Thanks!
This problem was because I did not check the capability “Internet (Client & Server)”. I didn’t realize that my network was not authenticated. It works perfectly now.
I have a similar case here. I am linking my Unity Hololens application to a dll which is built against .net framework (not UWP). This dll is listening to UDP multicast messages. It works on desktop but not on Hololens, it builds and runs but nothing is received. I checked the capability mentioned above, still not receiving anything.
Could you please let me know if you had any suggestions?