Skip to content

Commit

Permalink
Fix #1702 and #1728 (#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
sefakeles authored Aug 13, 2023
1 parent f5c18f8 commit 666f131
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pymodbus/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,19 @@ async def async_execute(self, request=None):
request.transaction_id = self.transaction.getNextTID()
packet = self.framer.buildPacket(request)
self.transport_send(packet)
req = self._build_response(request.transaction_id)
if self.params.broadcast_enable and not request.slave_id:
resp = b"Broadcast write sent - no response expected"
else:
count = 0
while count <= self.params.retries:
count += 1
try:
req = self._build_response(request.transaction_id)
resp = await asyncio.wait_for(
req, timeout=self.comm_params.timeout_connect
)
count = 0
break
except asyncio.exceptions.TimeoutError:
pass
count += 1
if count > self.params.retries:
self.close(reconnect=True)
raise ModbusIOException(
Expand Down

0 comments on commit 666f131

Please sign in to comment.