Merge pull request #16 from nneonneo/master

Fix magneticod on macOS.
This commit is contained in:
Bora M. Alper 2017-04-10 15:47:44 +04:00 committed by GitHub
commit dd37830b80

View File

@ -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()