Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get the published devices from multiple networks #121

Open
azharrahi opened this issue May 30, 2024 · 0 comments
Open

Unable to get the published devices from multiple networks #121

azharrahi opened this issue May 30, 2024 · 0 comments

Comments

@azharrahi
Copy link

azharrahi commented May 30, 2024

Hi, we have created a service which published the devices over the networks using RSSDP. Suppose the discoverable devices are connected to different networks and the client machine is connected to all of those networks at a time.

When we try to discover devices using DeviceAvailable event on client machine, connected to different networks at a time, using IpAddress.Any, then it only discovers the devices on a particular network that IpAddress belongs to and starts to ignore other networks.
That means we are able to discover the devices only from only one network.

Here is my the sample code which I have used:

``
private async Task BeginSearchAsync()
{
SsdpDeviceLocator _DeviceLocator = new SsdpDeviceLocator(IpAddress.Any);

_DeviceLocator.NotificationFilter = "upnp:rootdevice";

_DeviceLocator.DeviceAvailable += deviceLocator_DeviceAvailable;

_DeviceLocator.StartListeningForNotifications();

await _DeviceLocator.SearchAsync();

}

// Process each found device in the event handler
private async void deviceLocator_DeviceAvailable(object sender, DeviceAvailableEventArgs e)
{
//Can retrieve the full device description easily though.
var ipAddress = e.DiscoveredDevice.DescriptionLocation.Host;

// Code processing
}
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant