Make SO_REUSEPORT optional
- apparently not available on Windows
This commit is contained in:
parent
e7525d47be
commit
74f1a74a8c
|
@ -60,7 +60,10 @@ class UDPSocket(BMProto):
|
||||||
self.socket = sock
|
self.socket = sock
|
||||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
||||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
|
try:
|
||||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
self.destination = state.Peer(self.socket.getsockname()[0], self.socket.getsockname()[1])
|
self.destination = state.Peer(self.socket.getsockname()[0], self.socket.getsockname()[1])
|
||||||
ObjectTracker.__init__(self)
|
ObjectTracker.__init__(self)
|
||||||
self.connecting = False
|
self.connecting = False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user