I'd like to try 10 immediate modbus connections. However, everytime I fail to connect, and I have to wait for 2 minutes for the next connection because the previous modbus_connect call is still actively listening. So, if I fail to connect 10 times, I have to wait for 20 minutes.
int max_tries = 10;
int retries = 0;
while ((modbus_connect(ctx) == -1) && retries < max_retries){
retries++;
// wait 2 mins
// I need to remove this waiting time
}
Can someone help me to reduce the time for timeout? I'm using Libmodbus v3.1.6