Skip to content

Commit

Permalink
Merge pull request #269 from elias-a/reuse-port
Browse files Browse the repository at this point in the history
Add SO_REUSEADDR option before binding to port
  • Loading branch information
mwcraig authored Mar 14, 2024
2 parents 0fa1197 + 973033c commit 39969cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ We are certain the list is incomplete; please let one of us know by opening an [
+ Alex Herrera ([@aherrera1721](https://github.com/aherrera1721))
+ Michał Górny ([@mgorny](https://github.com/mgorny))
+ Ryder Johnson ([@UZ9](https://github.com/UZ9))
+ Elias Alstead ([@elias-a](https://github.com/elias-a))

## Full timeline of vpython development

Expand Down
1 change: 1 addition & 0 deletions vpython/no_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def signal_handler(signal, frame):

def find_free_port(port):
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('', port))
return s.getsockname()[1]

Expand Down

0 comments on commit 39969cc

Please sign in to comment.