You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me the invocation in server/base.py is superfluous, and should possibly be removed (?). OTOH, changing the behaviour would be a breaking change. OTOH again, this API is not exactly very well documented.
OS: macOS
pymodbus version 3.9.2
I supply the following dummy hook to the
trace_connect
argument duringModbusTcpServer
instantiation:Observed behaviour
Upon client connection (and subsequent disconnection), I get the following debug print on my console:
Apparently, the callback is invoked twice upon connect, and once upon disconnect.
Expected behaviour
I would expect only a single callback invocation upon connect:
Debugging
A quick, narrowed down, Git grep reveals the following invocations:
$ git grep -n 'self\.trace_connect(' pymodbus/server/base.py:64: self.trace_connect(True) pymodbus/transaction/transaction.py:205: self.trace_connect(True) pymodbus/transaction/transaction.py:209: self.trace_connect(False)
It seems to me the invocation in
server/base.py
is superfluous, and should possibly be removed (?). OTOH, changing the behaviour would be a breaking change. OTOH again, this API is not exactly very well documented.The superfluous invocation was added by @janiversen in commit bebccce, PR #2549, issue #2546.
The text was updated successfully, but these errors were encountered: