Skip to content

AsyncModbusTcpClient ignores reconnect_delay == 0  #1203

@Cavaler

Description

@Cavaler

pymodbus 3.0.2

Documentation says:

reconnect_delay doubles automatically with each unsuccessful connect. Set reconnect_delay=0 to avoid automatic reconnection.

However, creating AsyncModbusTcpClient(reconnect_delay=0) just causes it to reconnect immediately.

I would suggest checking for delay_ms in protocol_lost_connection() instead of host. Same in connect() on error.
And also set delay_ms to 0 in close(), this would allow calling connect() again on previously close()'s client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions