mdns: support running on macos

This commit is contained in:
ed
2022-11-17 20:18:24 +00:00
parent 5abe0c955c
commit 4ad4657774
5 changed files with 43 additions and 23 deletions

View File

@@ -165,6 +165,10 @@ class HttpSrv(object):
def listen(self, sck: socket.socket, nlisteners: int) -> None:
if self.args.j != 1:
# lost in the pickle; redefine
try:
sck.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
except:
pass
sck.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sck.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
sck.settimeout(None) # < does not inherit, ^ does