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
Don't apply the FD_SETSIZE check to Windows sockets
On Windows a SOCKET is an opaque handle, not a small index, and an fd_set
is a counted array of sockets rather than a bitmask. libmodbus only ever
puts a single socket in a set, so it can't overflow it.
The fd >= FD_SETSIZE checks added in 7b13341 therefore don't apply on
Windows, where they instead reject any socket whose handle value reaches
FD_SETSIZE (64 by default) - which happens after a few dozen open handles
and breaks Modbus TCP with EINVAL / "exceeds FD_SETSIZE".
Wrap the check in a macro that keeps it on POSIX and disables it on
Windows. POSIX behaviour is unchanged.
Fixes#842
0 commit comments