1.7.3 stable
What's Changed
- CI update by @bertmelis in https://github.com/eModbus/eModbus/pull/355
- Add function set timeout by @gary7530 in https://github.com/eModbus/eModbus/pull/373
- Prevent unnecessary reallocs by @monsieurvor in https://github.com/eModbus/eModbus/pull/384
- remove the front request only when the request queue is not empty. by @gary7530 in https://github.com/eModbus/eModbus/pull/394
- Update dependencies by @bertmelis in https://github.com/eModbus/eModbus/pull/398
- Fixes and additions for 1.7.3 by @Miq1 in https://github.com/eModbus/eModbus/pull/401
New TCP close-on-timeout function
@mifarelight raised an issue where a TCP connection on a client would hang for a long time if a server was cut off the network. Basically this was caused by the connected() call in the core still reporting true despite the fact that the connection was long gone.
To get around this, a new function was added to ModbusClientTCP:
// Set number of timeouts to tolerate before a connection is forcibly closed.
// 0: never, 1..255: desired number
// Returns previous value.
uint8_t closeConnectionOnTimeouts(uint8_t n=3);
Example:
ModbusClientTCP mbc;
...
mbc.closeConnectionOnTimeouts();
...
That will tolerate 3 consecutive timeouts (the default if called without value) and cut the connection upon the fourth. You can disable that by calling the function with a 0 argument.
New Contributors
- @gary7530 made their first contribution in https://github.com/eModbus/eModbus/pull/373
- @monsieurvor made their first contribution in https://github.com/eModbus/eModbus/pull/384
Full Changelog: https://github.com/eModbus/eModbus/compare/v1.7.2stable...v1.7.3.stable