Set socket.SO_REUSEADDR, so the server doesn't fail to reboot

This commit is contained in:
Fierelier 2022-07-05 15:34:11 +02:00
parent 5a9d6e265c
commit 4fafc334db
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ global makeServer
def makeServer(host,port,https):
print("Opening " +str(host)+ ":" +str(port)+ " (" +str(https)+ ") ...")
serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverSocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
serverSocket.bind((host,port))
if https:
proto = False