-
Notifications
You must be signed in to change notification settings - Fork 67
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
uPnP discovery suddenly stopp working? #93
Comments
UDP packets' delivery is not guaranteed - both broadcast message and response message can get lost in transfer. |
Also, I notice you have no error handling in your SearchForDevices method, and it's async void... so if an exception is occuring for some reason it's likely being swallowed silently. I would add a try catch in that method with some logging or a debugger break etc. and see if you get errors when it fails. RSSDP does follow the SSDP spec and send most packets multiple times with a delay between each in order to 'work around' the occasional packet loss, but obviously that's still only best effort and doesn't guarantee anything. However since it works for you on the first ~3 runs and then fails, it seems a little odd to be accidental packet loss. Could be something deliberately dropping the packets due to some sort of security measure (after it sees X number of packets in a short time), but it's really hard to diagnose remotely without the ability to repro. |
Wireshark or something to what's happening on your network is probably the next step, as suggested by @marchewek |
I've observed similar to @mohasi and numerous locations. In the end our solution was to run the query every 15 minutes via a cron job and build a MySQL data and then we display sorted by age. I tried compiling / running on Linux and Windows and found the results similar. |
That is odd, I wish I could reproduce so I had some chance of fixing it. I have it running in multiple networks and haven't seen this symptom. |
I'll pull out my code in the next few days and do some sniffing! FYI, when I first observed it I just thought somehow this library wasn't doing as good as of a job at finding devices as my Ubiquti Edge Router or UPnP Analyser in the MS Store - I'd left the tool running via a 1 minute cronjob piping to file and found that with time it would get the same results as the other tools. I will post back once I've done some additional digging. |
Is it possible those other tools use a larger wait time on the search command? If you're only waiting say 1 second for the search and some devices take longer than that to respond, those responses will get dropped. If those other systems are waiting 5 seconds on each search, they might drop fewer responses. Maybe. Just spitballing ideas here. |
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. |
I have the same problem with V4.0.4, I don't think it is a timing problem because I left the program running over night. I still can't find a solution. |
Anyone found a solution for this problem? Same issue here |
I am trying this but it does not always work:
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.
The text was updated successfully, but these errors were encountered: