We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0221a7 commit b87f4a0Copy full SHA for b87f4a0
pysolarmanv5/pysolarmanv5.py
@@ -295,7 +295,11 @@ def _data_receiver(self):
295
for event in events:
296
# We are registered only for inbound data on a single socket,
297
# so there is no need to check the (fileno, mask) tuples
298
- data = self.sock.recv(1024)
+ try:
299
+ data = self.sock.recv(1024)
300
+ except ConnectionResetError:
301
+ self.log.debug(f'[{self.serial}] Connection RESET by peer.')
302
+ data = b""
303
if data == b"":
304
self.log.debug(f"[POLL] Socket closed. Reader thread exiting.")
305
if self._data_wanted.is_set():
0 commit comments