I’m attempting to create more robust TCP/IP connections to our Rabbit RCM6760. It maintains a passive connection where application software connects and stays connected for long periods of time transferring data back and forth via a raw TCP connection. It works fine under most operating conditions.
We are having some issues with the connection locking up, where there is a connection error of some type and we cannot re-connect even after closing the application software. These are still being diagnosed on the software side, but it would be good for our Rabbit to take a more active role in analyzing the status of the connection and closing it if it’s in a strange state.
Most specifically, I noticed tcp_tick() and sock_fastread() don’t seem to detect when the ethernet cable is disconnected. I found this post:
http://cms.digi.com/support/forum/60345/can-you-check-to-see-if-an-ethernet-cable-connected-the-rabbit
that recommends using pd_havelink() to detect that condition at least, but I’m surprised tcp_tick() and sock_established() don’t call this at a lower level before checking for new data. Or if they do, I’m not aware of the right status to check that’s updated/returned by them.
Are there general tips for maintaining a robust connection using the Rabbit’s tcpip API?
Conditions we can ideally detect:
- Ethernet cable disconnected from Rabbit (can do using above)
- No connection to a network (Ethernet cable disconnected past a switch/hub, or no other devices on network)
- Application software has attempted to disconnect, but has done so incompletely (*RST packets have at least been sent both directions)
Any help is appreciated, thanks!
- James