diff --git a/magneticod/magneticod/bittorrent.py b/magneticod/magneticod/bittorrent.py index 63b8995..a3c399b 100644 --- a/magneticod/magneticod/bittorrent.py +++ b/magneticod/magneticod/bittorrent.py @@ -33,7 +33,8 @@ class DisposablePeer: self.__socket.setblocking(False) # To reduce the latency: self.__socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, True) - self.__socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True) + if hasattr(socket, 'TCP_QUICKACK'): + self.__socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True) res = self.__socket.connect_ex(peer_addr) if res != errno.EINPROGRESS: raise ConnectionError()