I need to know if a connection is active while I'm sending streaming video (via UDP) from a Raspberry pi. The only way I could think of was to perform a ping every 5 seconds (to 8.8.8.8) using the 'watch' command. While this works, I'm concerned that if the processor must wait for the return during a ping, that might sometimes screw up my video stream.
I'm also open to any better suggestions.