Skip to content

Conversation

@Mzack9999
Copy link
Member

No description provided.

@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Feb 23, 2021
@Mzack9999 Mzack9999 self-assigned this Feb 23, 2021
@ehsandeep
Copy link
Member

Auto retry is not working, if another HTTP service is listening on 8000, simplehttpserver just start on the same port and does receive any incoming request.

$./simplehttpserver -v
Serving . on http://0.0.0.0:8000/...

@ehsandeep ehsandeep added the Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. label Feb 23, 2021
@Mzack9999
Copy link
Member Author

On Windows and OSX listening on the same port is allowed as binaries are compiled with SO_REUSEPORT flag. On linux it isn't, so it behaves as expected:

$ go run .
Serving . on http://0.0.0.0:8000/...
Can't listen on 0.0.0.0:8000: listen tcp 0.0.0.0:8000: bind: address already in use - retrying with another port
Serving . on http://0.0.0.0:8001/...
Can't listen on 0.0.0.0:8001: listen tcp 0.0.0.0:8001: bind: address already in use - retrying with another port
Serving . on http://0.0.0.0:8002/...

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

Labels

Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. Type: Enhancement Most issues will probably ask for additions or changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Automatic binding to alternate port when default port is unavailable

3 participants