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

SO_REUSEADDR should not be used on windows #1088

Closed
bb-migration opened this Issue Aug 30, 2011 · 3 comments

Comments

Projects
None yet
4 participants
@bb-migration

bb-migration commented Aug 30, 2011

Originally reported by: Anonymous


The standard idiom of creating a socket with SO_REUSEADDR before binding, should not be done on windows. The meaning of this socket option is quite different on windows. On windows, the default behaviour is as though SO_REUSEADDR had been specified on unix.
If this flag is specified, it is possible to bind to a port that is actually in use.
See for example this discussion from twisted: http://twistedmatrix.com/trac/ticket/1151

And this documentaton on the flag and its windows specific colleagues:
http://msdn.microsoft.com/en-us/library/ms740621(v=vs.85).aspx

Reported by kristjan@ccpgames.com


@kyrias

This comment has been minimized.

kyrias commented Oct 16, 2017

Quickly looking over this, this would need to be changed in the flup WSGI servers rather than cherrypy, since the socket code itself is in those modules rather than in cherrypy.

@webknjaz

This comment has been minimized.

Member

webknjaz commented Oct 16, 2017

@kyrias, flup is a third-party we don't control. It is an optional dependency.
CherryPy 🍒 itself is used to implement its own WSGI, which has been factored out into a separate Cheroot distribution. Current issue is about that separate repository now.
Please consider sending PR there :)

@kyrias

This comment has been minimized.

kyrias commented Oct 16, 2017

Ah, completely missed that, seems I was looking in the wrong place, sorry 'bout that!

webknjaz added a commit to cherrypy/cheroot that referenced this issue Oct 17, 2017

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