in src/modbus-tcp.c the lines 274 and 282 are identical
rc = connect(sockfd, addr, addrlen);
the code can by simplified by removing both lines and replacing line 269
int rc = connect(sockfd, addr, addrlen);
Ah yes! I did that to avoid 'int' declaration after a call but didn't see 'int' could be placed on connect() line.
Avoid twice connect() in source code (closes #194)