We are trying to obtain the IP address of a WiFi device that is broadcasting it's IP address to 255.255.255.255 to port 15000.
In UWP, the following code works
Task<UdpReceiveResult> task = udpClient.ReceiveAsync();
task.Wait();
UdpReceiveResult result = task.Result;
However, on iOS, the exact same code hangs and never returns a result.
In both cases, the WiFi device is connected to a hotspot (on the UWP & iOS devices).
I've also tried using this plugin, with the same outcome.
Although, when I did get it working on UWP, I was unable to also tie a TcpClient in with the GUI for the same reason. Seems to be something strange going on with threads, but am not entirely sure what or why. I can only get both (udp & tcp) to work reliably on UWP when called from the App() constructor in the PCL project.
We really only need to get this working on iOS.
Can anybody shed some light on the situation?
Much appreciated...cheers