Skip to content

Commit

Permalink
Shutdown network transport (#153)
Browse files Browse the repository at this point in the history
Shutdown socket before close. Some OS:es seem to not wake up the reading thread on close, but will do so on shutdown. So add a workaround.
  • Loading branch information
rhpijnacker committed Apr 9, 2024
1 parent caba852 commit dbff7d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions RFXtrx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ def reset(self):
def close(self):
""" close connection to rfxtrx device """
with suppress(socket.error):
self.sock.shutdown(socket.SHUT_RDWR)
self.sock.close()


Expand Down

0 comments on commit dbff7d9

Please sign in to comment.