mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-12-27 17:37:39 +01:00
Try to set TCP_QUICKACK where support for that option is available (#932)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
fce8922aa3
commit
ec08c49cf1
@ -374,6 +374,13 @@ class APIConnection:
|
|||||||
self._socket = sock
|
self._socket = sock
|
||||||
sock.setblocking(False)
|
sock.setblocking(False)
|
||||||
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
||||||
|
try:
|
||||||
|
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, 1)
|
||||||
|
except AttributeError:
|
||||||
|
_LOGGER.debug(
|
||||||
|
"%s: TCP_QUICKACK not supported",
|
||||||
|
self.log_name,
|
||||||
|
)
|
||||||
self._increase_recv_buffer_size()
|
self._increase_recv_buffer_size()
|
||||||
self.connected_address = sock.getpeername()[0]
|
self.connected_address = sock.getpeername()[0]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user