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

DiscoverAsync strange behaviour between Debug sessions #51

Closed
szilardx opened this issue Sep 1, 2017 · 2 comments
Closed

DiscoverAsync strange behaviour between Debug sessions #51

szilardx opened this issue Sep 1, 2017 · 2 comments

Comments

@szilardx
Copy link

szilardx commented Sep 1, 2017

I am experiencing a strange behaviour in Visual Studio 2015.
If I use the DiscoveryAsync method, as presented in the samples (+ .ConfigureAwait(false) to avoid deadlocks), I get many devices, the program obeys the interval settings - so it works well.
Then if I press stop, and then start again the Debugging session, from console output results I can see that only a few devices are found, and the method does not obey the interval setting.

I tested this behaviour with the non async version of the method, and this is not present there.

Could it be the case that I am doing something wrong, or can I use the Async version in a production code reliably?

Thanks in advance! 👍


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@lextm
Copy link
Collaborator

lextm commented Sep 1, 2017

You might check if there are changes in packets first,

http://docs.sharpsnmp.com/en/latest/tutorials/troubleshooting.html

@szilardx
Copy link
Author

szilardx commented Sep 4, 2017

I checked with Wireshark. I can clearly see the get-request from my computer to the broadcast address, and then 19 get-response from the local network devices - in both case.
In the first c# debug session in Visual Studio 2015 I can see the AgentFound event being triggered aroud 19 times.
But in the second debug session (no code change) the AgentFound event only happens 3-7 times, and also the breakpoint is being hit earlier than 16 seconds. (The 16 seconds I set is waited on the first run.)
If I restart the Viusal Studio, then the DiscoverAsync works as expected - 19 devices found, 16 sec wait etc.

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

No branches or pull requests

2 participants