Commit 4795c58f authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

sock-server.py: Use SO_REUSEADDR to avoid errors on quick restart.

parent a88c30c6
......@@ -16,6 +16,7 @@ ai = socket.getaddrinfo("127.0.0.1", 8080)
print("Bind address info:", ai)
addr = ai[0][4]
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(addr)
s.listen(5)
print("Listening, connect your browser to http://127.0.0.1:8080/")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment