-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fixes in AcceptThread method #89
Fixes in AcceptThread method #89
Conversation
NetworkStream throws: System.IO.IOException, System.ArgumentNullException SslStream throws: System.IO.IOException, System.ArgumentNullException, NotSupportedException none of these exceptions are caught, nothing can throw the SocketException exception
Hi @MateuszKlatecki, I'm nanoFramework bot. A human will be reviewing it shortly. 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MateuszKlatecki the SocketException is thrown in the native end. Removing this code block seems a bit harsh…
Agreed on the need to catch other exceptions.
As for retry
var it was wrongly removed on this commit as part of a clean-up from Sonarcloud suggested improvements: f3122ac
So it should be put back where it was. Unless there is a good reason for dropping this 5 attempts strategy.
(which I'm not advocating it has to be there, just pointing out).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a closer look, the error from SonarCloud doesn't look right... (and this is what caused that line to be removed). The retry
var is being reset after a successful return from socket Accept() and their algorithm seems to be ignoring that, like if the fact that's inside a try catch necessarily means that the execution will go away.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
It seems that pre-incrementation has solved the problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice workaround!
LGTM.
Description
Only the SocketException was caught, but it was possible to throw:
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist:
Signed-off-by: Mateusz Klatecki mateusz.klatecki@gc5.pl