commit
dd37830b80
@ -33,7 +33,8 @@ class DisposablePeer:
|
|||||||
self.__socket.setblocking(False)
|
self.__socket.setblocking(False)
|
||||||
# To reduce the latency:
|
# To reduce the latency:
|
||||||
self.__socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, True)
|
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)
|
res = self.__socket.connect_ex(peer_addr)
|
||||||
if res != errno.EINPROGRESS:
|
if res != errno.EINPROGRESS:
|
||||||
raise ConnectionError()
|
raise ConnectionError()
|
||||||
|
Loading…
Reference in New Issue
Block a user