Skip to content

No explicit timeout on client TCP/IP connections #1130

@alexrudd2

Description

@alexrudd2

Versions

  • Python: 3.10
  • OS: MacOSX
  • Pymodbus: b4f5a55
  • Modbus Hardware (if used): any (I'm using a Productivity2000 PLC)

Pymodbus Specific

  • Client: TCP/IP async

Description

The TCP/IP client connection code does not obey the timeout parameter inherited from ModbusBaseClient https://github.com/riptideio/pymodbus/blob/b4f5a558254f8242fd65fb49fe10f4f255610b32/pymodbus/client/base.py#L22-L28

This is because it relies on loop.create_connection(), which does not have any overall timeout parameter. A failed network call will eventually timeout in 45-120s, although I'm not sure which layer actually does it. (There is only ssl_handshake_timeout but this is very specific)

https://github.com/riptideio/pymodbus/blob/b4f5a558254f8242fd65fb49fe10f4f255610b32/pymodbus/client/tcp.py#L82-L89

(PR incoming)

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