Set socket.SO_REUSEADDR, so the server doesn't fail to reboot
This commit is contained in:
parent
1b36386eae
commit
305e9a4307
@ -34,6 +34,7 @@ global makeServer
|
|||||||
def makeServer(host,port,https):
|
def makeServer(host,port,https):
|
||||||
print("Opening " +str(host)+ ":" +str(port)+ " (" +str(https)+ ") ...")
|
print("Opening " +str(host)+ ":" +str(port)+ " (" +str(https)+ ") ...")
|
||||||
serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
serverSocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
|
||||||
serverSocket.bind((host,port))
|
serverSocket.bind((host,port))
|
||||||
if https:
|
if https:
|
||||||
proto = False
|
proto = False
|
||||||
|
Loading…
Reference in New Issue
Block a user