Set socket.SO_REUSEADDR, so the server doesn't fail to reboot
This commit is contained in:
parent
5a9d6e265c
commit
4fafc334db
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue