Skip to content

Commit 4795c58

Browse files
committed
sock-server.py: Use SO_REUSEADDR to avoid errors on quick restart.
1 parent a88c30c commit 4795c58

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

examples/unix/sock-server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
print("Bind address info:", ai)
1717
addr = ai[0][4]
1818

19+
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
1920
s.bind(addr)
2021
s.listen(5)
2122
print("Listening, connect your browser to http://127.0.0.1:8080/")

0 commit comments

Comments
 (0)