question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

uPnP discovery suddenly stopp working?

See original GitHub issue

I am trying this but it does not always work:

using Rssdp;
using System;

namespace Discovery {
  class Program {
    static void Main(string[] args) {
      SearchForDevices();
      Console.ReadKey();
    }

    public static async void SearchForDevices() {
      using (var deviceLocator = new SsdpDeviceLocator()) {
        var foundDevices = await deviceLocator.SearchAsync();

        foreach (var foundDevice in foundDevices) {
          Console.WriteLine("Found " + foundDevice.Usn + " at " + foundDevice.DescriptionLocation.ToString());
        }
      }
    }
  }
}

It only shows output for the first 3 runs or so. Then for the rest of the day I get nothing. I have checked the firewall settings in windows and allowed UDP in and out on all ports. Still the same. Not even sure how to debug.

I am running this from .NET Core Console App, in Windows 10.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
winkmichaelcommented, Sep 9, 2020

Yes, good idea. I just did a super unscientific test and ran the UPNP discovery on my Ubiquiti, without knowing how the thing works, two observations; 1. Nothing appears in the list for at least 15 - 20 seconds, 2. The list of devices found populates over a several minute period.

1reaction
marchewekcommented, Sep 9, 2020

UDP packets’ delivery is not guaranteed - both broadcast message and response message can get lost in transfer. In general discovery should be treated as convenience improvement and implemented side-by-side with manual configuration. And since discovery can be used as a vector of DDoS attacks, I’d also recommend implementing possibility to turn discovery completely off (enabling/disabling firewall rule; I’d additionally restrict the rule to local LAN). If you want to see what is going on in the network, you could install any sniffing tool, e.g. Wireshark

Read more comments on GitHub >

github_iconTop Results From Across the Web

UPnP discovery failed
I have tried 1.20 1.21 on my A2 655. For Vista SP1, it can always discover the network map and UPnP device correctly....
Read more >
9 Ways to Fix Network Discovery Not Working in Windows 10
Follow these steps to change Services settings and get network discovery working again:
Read more >
UPNP Discovery is not running - HomeSeer Message Board
After a power failure, I restarted my HomeSeer. Noticed that the logs are repeatedly being flooded by the messages below.
Read more >
UPnP/DLNA device discovery not working
I'm having trouble discovering UPnP/DLNA devices on my network. Discovery seems to be unreliable; I've tried several UPnP device listing ...
Read more >
Can't turn on Network Discovery - Windows Client
Cause. This issue occurs for one of the following reasons: The dependency services for Network Discovery aren't running. The Windows firewall ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found