[Live-devel] Reconnect after lost connection

Ross Finlayson finlayson at live555.com
Tue Jul 6 22:38:33 PDT 2010


>How can I check when the connection to the RTSP server has been 
>broken due to network failure?  I have a RTSP client streaming video 
>and saving this to disk using a MediaSink.  Is there a way to 
>specify a timeout on the RTP socket and then have a callback on this 
>timeout?

I suggest using "TaskScheduler::scheduleDelayedTask()" to set up a 
'watchdog timer' immediately after you've gotten a response from the 
RTSP "PLAY" command, and reset this timer each time new data arrives 
in your 'sink' object.  (You can do this by subclassing your sink 
class, and redefining the "continuePlaying()" virtual function to 
reset the watchdog timer (and then call the parent class's 
"continuePlaying()".)

This will check not only for 'network failure', but also for the server dying.

You can reset the watchdog timer using 
"TaskScheduler::rescheduleDelayedTask()".
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list