paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.76k stars 357 forks source link

UWP Inetnet Connect Failed #831

Closed chenzil1121 closed 1 year ago

chenzil1121 commented 1 year ago

Hi, It's a really great work. It helped me successfully build remote rendering applications on Windows and Ubuntu.

https://user-images.githubusercontent.com/52343644/225301385-3affde54-aa2a-417c-9c18-214f5f49ca3d.mp4

However, when I moved the application to the UWP, I encountered an error that prevented me from connecting to a non-local IP address.

stun fail

I think these are some problems with cmake build UWP projects. #379 I know examples that already support UWP now. But I'm confused about how UWP builds properly and why it doesn't connect to non-local IP addresses

I followed #216 build the UWP project.
cmake -B build -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0"
When I tested the stream example, I found that failed to connect stun:stun.l.google.com:19302. And WebSocket cannot connect to non-local IP addresses. I am not familiar with the UWP project, and I hope someone can point out if I make a stupid mistake.

I've learned that libdatachannel works perfectly on Hololens 1 #419. I would also like to know if there are any potential problems if I apply libdatachannel to Hololens 2 C++ OpenXR environment (such as network access, or WinRT adaptation). @hanseuljun

hanseuljun commented 1 year ago

It's good help someone working on building a hololens app using libdatachannel, while I am a little sorry that you have to go through this UWP development experience.

My first guess is, did you turn on the Internet capability for your app? Maybe you simply did not give your app permission to connect to other devices: https://learn.microsoft.com/en-us/windows/uwp/networking/networking-basics

Besides that, all I can say is I did use libdatachannel for building a C++ OpenXR app and it worked on hololens 1 so there is hope. Also, UWP does have its own peculiarities, so probably this relates to just one of them. One example: https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh780593(v=win.10)

chenzil1121 commented 1 year ago

Thanks! I didn't notice that UWP programs require a list of permissions. I will try to apply libdatachannel on Hololens 2!