sockets-for-pcl icon indicating copy to clipboard operation
sockets-for-pcl copied to clipboard

Using CommsInterface.GetAllInterfacesAsync() to use with StartListeningAsync()

Open melucas opened this issue 6 years ago • 0 comments

Hello,

In my Xamarin forms project in a view model, I can successfully find the first connected network interface using CommsInterface.GetAllInterfacesAsync() (as per the example in the readme file).

When I pass the interface object to the UdpSocketReceiver StartListeningAsync(port, ni), the connection does not fire the MessageReceived event. If the network interface object is null, or StartListeningAsync is called with just the port number, the MessageReceived event fires with the received data from the UDP Server.

I would like to be able to tell the UdpSocketReceiver which network interface to listen on because the server will always be on a WiFi connection. There is no need to listen to the mobile network.

Any idea how to make this work?

melucas avatar Jan 24 '19 19:01 melucas