-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve docs around sync clients and reconnection #2321
Conversation
Sync clients don't do reconnection in the same way as async clients, and should have a little more explanation as to what they do. See issue pymodbus-dev#2320
|
||
from pymodbus.client import ModbusTcpClient | ||
|
||
client = ModbusTcpClient('MyDevice.lan') # Create client object | ||
client.connect() # connect to device, reconnect automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the fact, that a reconnect is done with the next request.
doc/source/client.rst
Outdated
@@ -153,6 +166,9 @@ The line :mod:`result = await client.read_coils(2, 3, slave=1)` is an example of | |||
|
|||
The last line :mod:`client.close()` closes the connection and render the object inactive. | |||
|
|||
Usage notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The notes have nothing to do with the usage! it merely an information.
pymodbus/client/tcp.py
Outdated
**reconnect_delay** doubles automatically with each unsuccessful connect, from | ||
**reconnect_delay** to **reconnect_delay_max**. | ||
Set `reconnect_delay=0` to avoid automatic reconnection. | ||
Note that unlike the async client, the sync client does not perform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing an empty line,
pymodbus/client/tls.py
Outdated
**reconnect_delay** doubles automatically with each unsuccessful connect, from | ||
**reconnect_delay** to **reconnect_delay_max**. | ||
Set `reconnect_delay=0` to avoid automatic reconnection. | ||
Note that unlike the async client, the sync client does not perform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing an empty line.
pymodbus/client/udp.py
Outdated
**reconnect_delay** doubles automatically with each unsuccessful connect, from | ||
**reconnect_delay** to **reconnect_delay_max**. | ||
Set `reconnect_delay=0` to avoid automatic reconnection. | ||
Note that unlike the async client, the sync client does not perform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing an empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Sync clients don't do reconnection in the same way as async clients, and should have a little more explanation as to what they do.
fixes #2320
Verified that docs successfully build and look right.