Skip to content

v1.5.0

Choose a tag to compare

@github-actions github-actions released this 02 Mar 14:50
· 5 commits to main since this release
Fix Windows EINVAL on connect: override FD_SETSIZE for libmodbus

libmodbus checks 'if (socket >= FD_SETSIZE)' and returns EINVAL.
On Linux FD_SETSIZE=1024 and fd numbers are small, so this works.
On Windows FD_SETSIZE=64 and SOCKET handles are opaque kernel values
that are typically >> 64, causing every connection attempt to fail
with 'Invalid argument'.

Fix: pass CPPFLAGS=-DFD_SETSIZE=4096 when building libmodbus on
Windows so the check no longer rejects valid socket handles.