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

Don't use SO_REUSEADDR on Windows #53

Merged
merged 3 commits into from
Oct 17, 2017

Conversation

kyrias
Copy link
Contributor

@kyrias kyrias commented Oct 16, 2017

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix(?)

  • What is the related issue number (starting with #)

cherrypy/cherrypy#1088

  • What is the current behavior? (You can also link to an open issue here)

To bind using SO_REUSEADDR on all platforms

  • What is the new behavior (if this is a feature change)?

To not bind using SO_REUSEADDR on Windows.

On Windows the SO_REUSEADDR sockopt has different semantics, so we don't
want to enable it there.

See https://msdn.microsoft.com/en-us/library/ms740621(v=vs.85).aspx

Fixes cherrypy/cherrypy#1088

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Would you please add a reference to the reason of doing this in comments?

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
@codecov
Copy link

codecov bot commented Oct 16, 2017

Codecov Report

Merging #53 into master will decrease coverage by 0.1%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   58.98%   58.87%   -0.11%     
==========================================
  Files          18       18              
  Lines        3279     3280       +1     
==========================================
- Hits         1934     1931       -3     
- Misses       1345     1349       +4

@kyrias
Copy link
Contributor Author

kyrias commented Oct 16, 2017

Do you want me to add the msdn link as well? And should I squash the two commits?

@webknjaz
Copy link
Member

Yeah, it would be nice to have that link and maybe some test. Don't squash commits.

@kyrias
Copy link
Contributor Author

kyrias commented Oct 16, 2017

Not sure what kind of test you were thinking? Try to bind an instance, and checking if the sockopt is set would work I guess, but it doesn't feel like that would be a very useful test, hm.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
@webknjaz
Copy link
Member

Well, I'll accept this PR without additional test for now. Just wanted to hear your suggestions.

@webknjaz webknjaz merged commit 93d77a2 into cherrypy:master Oct 17, 2017
@webknjaz
Copy link
Member

@kyrias thank you!

@kyrias kyrias deleted the reuseaddr-windows branch October 17, 2017 18:10
jaraco added a commit that referenced this pull request Nov 16, 2017
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.

None yet

2 participants