[Live-devel] [PATCH] Declare RTSP server's timeout

Warren Young warren at etr-usa.com
Tue Aug 19 21:59:58 PDT 2008


live555MediaServer has a hard-coded 45-second timeout in it for 
detecting clients that go away without telling the server.  The timer 
gets reset when a client sends another RTSP command, which a conforming 
client does periodically to convince the server that it is still alive.

RFC 2326 (RTSP) says the default timeout should be 60 seconds.  (Section 
12.37)  My patch doesn't change this, but you should consider doing so. 
  It's line 44 in mediaServer/DynamicRTSPServer.cpp.

That section of the RFC also says that if the server wants a different 
timeout, it should tell the client what value it uses in response to the 
client's SETUP command, so it will know to change how often it sends its 
keepalive packets.  The attached patch does this.

live555MediaServer passes this hard-coded timeout value to its 
RTSPServer instance, which stores it in a member variable called 
fReclamationTestSeconds.  The patch adds a constructor parameter to 
RTSPServer::RTSPClientSession to accept a similar value, stored in a 
member variable called fSessionTimeout.  (I chose the different name 
because its meaning changes somewhat in this object.)  The session 
object adds this value to the Session: headers in response to SETUP 
commands from the client, per the RFC.

The patch doesn't handle the case where PLAY and SETUP are combined.  I 
decided not to mess with this for a few reasons.  First, I don't have 
such a client.  Second, it's nonstandard behavior, but I presume at 
least one client that does this has been tested against the server, and 
it works now, so I guess it doesn't need to be told the timeout.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: live555-rtsp-server-session-timeout.patch
Type: text/x-patch
Size: 4705 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20080819/1b49d137/attachment.bin>


More information about the live-devel mailing list