Closed karlp closed 10 years ago
Ok, this only is a problem for the pi contexts. I just switched to regular tcp for the master, and it works just fine now. For tcp, it ignores the ip address if you use the listen/accept pairs
Hi Karl,
Never too late ;) Thanks for the report.
Thanks for this, and thanks for #190 as well, making the regular tcp_ method also observe the addresses passed in :)
In modbus_new_tcp_pi(), (I haven't looked at the regular version), the following code is used to set up the hostname of the remote server: https://github.com/stephane/libmodbus/blob/master/src/modbus-tcp.c#L701
Then in
modbus_tcp_pi_listen
there is a check no the node element being 0, which then properly sets up the socket to listen on NULL, for any address. https://github.com/stephane/libmodbus/blob/master/src/modbus-tcp.c#L435However, given the way the check is done in new(), there's no way to set the node to a zero value. I suggest that if the incoming node is NULL, that it be set to zero,