sourceperl / pyModbusTCP

A simple Modbus/TCP library for Python
MIT License
308 stars 106 forks source link

ModbusTcpClient.is_socket_open() always true #45

Closed Jeroen6 closed 3 years ago

Jeroen6 commented 3 years ago

is_socket_open() keeps returning True when the connection is closed by something other than close(). For example, when the remote node issues a FIN due to timeout.

Plus trying to catch the ConnectionException(msg) that will be raised when trying to use the closed socket gives a NameError, but that is maybe my problem.

is_socket_open() should return false when the tcp connection is closed.

Jeroen6 commented 3 years ago

Sorry, this repo is not from PyModbus....

(this one is better)