I'm wondering how I can use the mobile broadband connection of a device from my application, written as a UWP app. I am using the following code that allows me to connect to the desired device via WiFi, but it isn't working via the mobile broadband connection. The device contains a Machine-To-Machine SIM card that links to our company network.
private async void button1_Click(object sender, RoutedEventArgs e) {
var sSocket = new Windows.Networking.Sockets.StreamSocket();
try {
var res = sSocket.ConnectAsync(new Windows.Networking.HostName("10.203.120.71"), "80");
await res.AsTask();
await NotifyUser(res.Status.ToString());
}
catch (Exception) {
await NotifyUser("Failed", "haha");
}
}
I haven't found any information on needing to use a different socket type for mobile internet connections, so I'm wondering what I'm missing here.