Skip to content

Conversation

@camtarn
Copy link
Contributor

@camtarn camtarn commented Sep 14, 2024

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.

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
Copy link
Collaborator

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.


The last line :mod:`client.close()` closes the connection and render the object inactive.

Usage notes
Copy link
Collaborator

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.

**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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing an empty line,

**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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing an empty line.

**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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing an empty line.

Copy link
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@janiversen janiversen merged commit 42fef3b into pymodbus-dev:dev Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModbusTcpClient doesn't do reconnects?

2 participants