mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Fix setting MQTT socket buffer size with WebsocketWrapper (#117672)
This commit is contained in:
@ -540,6 +540,14 @@ class MQTT:
|
||||
|
||||
def _increase_socket_buffer_size(self, sock: SocketType) -> None:
|
||||
"""Increase the socket buffer size."""
|
||||
if not hasattr(sock, "setsockopt") and hasattr(sock, "_socket"):
|
||||
# The WebsocketWrapper does not wrap setsockopt
|
||||
# so we need to get the underlying socket
|
||||
# Remove this once
|
||||
# https://github.com/eclipse/paho.mqtt.python/pull/843
|
||||
# is available.
|
||||
sock = sock._socket # noqa: SLF001
|
||||
|
||||
new_buffer_size = PREFERRED_BUFFER_SIZE
|
||||
while True:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user