Skip to content

Commit

Permalink
Try to set TCP_QUICKACK where support for that option is available (#932
Browse files Browse the repository at this point in the history
)

Co-authored-by: J. Nick Koston <[email protected]>
  • Loading branch information
nkinnan and bdraco authored Aug 29, 2024
1 parent fce8922 commit ec08c49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aioesphomeapi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ async def _connect_socket_connect(self, addrs: list[hr.AddrInfo]) -> None:
self._socket = sock
sock.setblocking(False)
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.connected_address = sock.getpeername()[0]

Expand Down

0 comments on commit ec08c49

Please sign in to comment.