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

Projects
None yet
2 participants
@kyrias
Contributor

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.

Don't use 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>
@webknjaz

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

Add comment about Windows' different REUSEADDR semantics
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
@codecov

This comment has been minimized.

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

This comment has been minimized.

Contributor

kyrias commented Oct 16, 2017

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

@webknjaz

This comment has been minimized.

Member

webknjaz commented Oct 16, 2017

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

@kyrias

This comment has been minimized.

Contributor

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.

Add URL to MSDN page on SO_REUSEADDR semantics
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
@webknjaz

This comment has been minimized.

Member

webknjaz commented Oct 17, 2017

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

6 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codeclimate All good!
Details
codecov/patch 100% of diff hit (target 58.98%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
lgtm analysis: Python No alert changes
Details
@webknjaz

This comment has been minimized.

Member

webknjaz commented Oct 17, 2017

@kyrias thank you!

@kyrias kyrias deleted the kyrias:reuseaddr-windows branch Oct 17, 2017

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