Use SO_REUSEADDR before calling bind() where missing. Fixes #1289.

This commit is contained in:
grossmj committed 2018-04-16 16:36:36 +08:00
1 parent 5c4f6dd3dc
commit dd9c18b9f8
4 files changed
+4 -1

No files matched your search

@@ -191,6 +191,7 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
try:
# get a random port on localhost
with socket.socket() as s:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((ip_address, 0))
api_port = s.getsockname()[1]
except OSError as e: