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

snet: fix UDP port selection on Windows #4656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lschulz
Copy link

@lschulz lschulz commented Nov 24, 2024

SNET is checking the wrong error code when probing for available UDP ports.
Windows socket error codes are completely different from Linux, thus different OSes must be distinguished.

@lschulz lschulz requested a review from a team as a code owner November 24, 2024 13:52
@jiceatscion
Copy link
Contributor

This change is Reviewable

Copy link
Contributor

@jiceatscion jiceatscion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem necessary to duplicate the code. If the only difference is the value of the error code, then please make a windows and unix versions of just that constant (of a function that abstracts iit to "thisIsTheErrorYourLookingFor()".

Reviewed 1 of 4 files at r1, all commit messages.
Reviewable status: 1 of 4 files reviewed, all discussions resolved

Copy link
Author

@lschulz lschulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a function errorIsAddrUnavailable() to test if the error code indicates an unavailable port as there are at least two error codes indicating this kind of situation in Windows.

Reviewable status: 0 of 6 files reviewed, all discussions resolved (waiting on @jiceatscion)

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

Successfully merging this pull request may close these issues.

2 participants