Skip to content

Commit 960bc0f

Browse files
author
Christian Bergmiller
committed
[ADD] use _connected property instead of _connected_event
1 parent 25fad28 commit 960bc0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymodbus/client/async/asyncio/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ def protocol_made_connection(self, protocol):
725725
Protocol notification of successful connection.
726726
"""
727727
_logger.info('Protocol made connection.')
728-
if not self._connected_event.is_set():
728+
if not self._connected:
729729
self._connected_event.set()
730730
self.protocol = protocol
731731
else:
@@ -736,7 +736,7 @@ def protocol_lost_connection(self, protocol):
736736
"""
737737
Protocol notification of lost connection.
738738
"""
739-
if self._connected_event.is_set():
739+
if self._connected:
740740
_logger.info('Protocol lost connection.')
741741
if protocol is not self.protocol:
742742
_logger.error('Factory protocol callback called'

0 commit comments

Comments
 (0)