So I connect with a TCP client and read a modbus from a TCP Server (arduino unit), if the arduino restarts, it looks like there's no FIN sent to any connected TCP clients to end the connection gracefully.
When this happens I'm in a half-open state, so the tcp client doesn't properly detect it's disconnected. No data or requests to read the modbus is visible on wireshark. I currently am not able to test with the arduino itself, so just getting feedback from the tester (yay covid), and the tester hasn't really been forthcoming with any errors they may see (or the error logs) and my own sneaky error logs being synced to the cloud isn't showing up, so wondering how the hell I'm able to detect a failure anywhere in the pipeline if nothing happens.
The modbus, when it tries to read, gets a 0 byte back if unsuccessful, retries 3 times and then throws an exception, but the 0 byte read only comes back if the tcp server connection is severed gracefully. I think Windows has like a 2 hour timeout on TCP sitting there retrying until it eventually times out, and I'm really not in the mood to go to unmanaged code and write something like that to override the timeout nor change registry settings on the machine the service sits on.
Done in c# but any advice would be great!
When this happens I'm in a half-open state, so the tcp client doesn't properly detect it's disconnected. No data or requests to read the modbus is visible on wireshark. I currently am not able to test with the arduino itself, so just getting feedback from the tester (yay covid), and the tester hasn't really been forthcoming with any errors they may see (or the error logs) and my own sneaky error logs being synced to the cloud isn't showing up, so wondering how the hell I'm able to detect a failure anywhere in the pipeline if nothing happens.
The modbus, when it tries to read, gets a 0 byte back if unsuccessful, retries 3 times and then throws an exception, but the 0 byte read only comes back if the tcp server connection is severed gracefully. I think Windows has like a 2 hour timeout on TCP sitting there retrying until it eventually times out, and I'm really not in the mood to go to unmanaged code and write something like that to override the timeout nor change registry settings on the machine the service sits on.
Done in c# but any advice would be great!