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
Windows (but I believe the problem also exists on *NIX)
Environment
N/A
Description
With TCP, modbus_connect() returns -1 on timeout, but does not set errno.
The reason seems to be that the timeout is implemented via select(), where a timeout is not considered an error. The offending code is in lines 295–299 of modbus-tcp.c, which look like this:
libmodbus version
3f9f17e (current
master
)OS and/or distribution
Windows (but I believe the problem also exists on *NIX)
Environment
N/A
Description
With TCP,
modbus_connect()
returns -1 on timeout, but does not seterrno
.The reason seems to be that the timeout is implemented via
select()
, where a timeout is not considered an error. The offending code is in lines 295–299 ofmodbus-tcp.c
, which look like this:Expected behavior or suggestion
errno == ETIMEDOUT
The text was updated successfully, but these errors were encountered: