Skip to content

Commit 9ea79b7

Browse files
authored
Transfer parms. to connected client. (#1161)
1 parent 30f7166 commit 9ea79b7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

pymodbus/client/tcp.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,16 @@ async def close(self): # pylint: disable=invalid-overridden-method
7777
def _create_protocol(self):
7878
"""Create initialized protocol instance with factory function."""
7979
protocol = ModbusClientProtocol(
80-
framer=self.params.framer, xframer=self.framer, **self.params.kwargs
80+
framer=self.params.framer,
81+
xframer=self.framer,
82+
timeout=self.params.timeout,
83+
retries=self.params.retries,
84+
retry_on_empty=self.params.retry_on_empty,
85+
close_comm_on_error=self.params.close_comm_on_error,
86+
strict=self.params.strict,
87+
broadcast_enable=self.params.broadcast_enable,
88+
reconnect_delay=self.params.reconnect_delay,
89+
**self.params.kwargs,
8190
)
8291
protocol.factory = self
8392
return protocol

pymodbus/client/udp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ def _create_protocol(self, host=None, port=0):
9999
use_udp=True,
100100
framer=self.params.framer,
101101
xframer=self.framer,
102+
timeout=self.params.timeout,
103+
retries=self.params.retries,
104+
retry_on_empty=self.params.retry_on_empty,
105+
close_comm_on_error=self.params.close_comm_on_error,
106+
strict=self.params.strict,
107+
broadcast_enable=self.params.broadcast_enable,
108+
reconnect_delay=self.params.reconnect_delay,
102109
**self.params.kwargs,
103110
)
104111
protocol.params.host = host

0 commit comments

Comments
 (0)