yes, thatβs the way. kinda like sending a heartbeat ping. With its UDP and with its simple header message, you can reduce the frequency to say 10 seconds. This should not lead to a deterioration in the quality of a measurable system, since we are talking only about the two systems that we are talking about.
I feel that UDP may be better than TCP. Its light weight, does not consume a lot of system resources and is theoretically faster. The downside may be packet loss. You can get around this by introducing some logic, for example, when 10 packets (at a distance of 10 seconds from each other) are not received sequentially, and then declare another system unavailable.
Srikar appalaraju
source share