Skip to content

Commit 76ab54a

Browse files
author
brentru
committed
timeout instead of nonblocking to avoid cpython ssl error
1 parent ee19319 commit 76ab54a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -866,14 +866,12 @@ def _wait_for_msg(self, timeout=0.1):
866866
buf = self._rx_buffer
867867
res = bytearray(1)
868868

869-
self._sock.settimeout(0)
869+
# Attempt to read
870+
self._sock.settimeout(1)
870871
try:
871872
self._sock.recv_into(res, 1)
872-
print("Resp: ", res)
873-
except BlockingIOError: # fix for macOS Errno
874-
return None
873+
print("Resp: ", res) # TODO BR: Remove debugging
875874
except self._socket_pool.timeout:
876-
print("timeout!")
877875
return None
878876

879877
# Block while we parse the rest of the response

0 commit comments

Comments
 (0)