[Live-devel] Timeout on reception of RTSP commands

Massimo Perrone massimo.perrone at innovatrieste.it
Thu Dec 10 07:06:44 PST 2020


Got it. Thank you Ross,

Massimo



________________________________
From: live-devel <live-devel-bounces at us.live555.com> on behalf of Ross Finlayson <finlayson at live555.com>
Sent: Thursday, December 10, 2020 1:31 PM
To: LIVE555 Streaming Media - development & use <live-devel at us.live555.com>
Subject: Re: [Live-devel] Timeout on reception of RTSP commands



> On Dec 10, 2020, at 10:01 PM, Massimo Perrone via live-devel <live-devel at us.live555.com> wrote:
>
> I'm having troubles with a buggy RTSP server which (for reasons that I cannot control) does not respond to the RTSP OPTION command while leaving the connection opened.
> In such a case, the livemedia RTSPClient hangs up until the server responds or close the connection.

The RTSP client isn’t really ‘hanging’ here, because I/O in LIVE555-based applications is asynchronous (i.e., non-blocking).  What it is doing, however, is just sitting in the event loop, waiting for an event (in this case, an incoming response to the earlier RTSP “OPTIONS” request) that never happens.  The client will still handle any other event that occurs instead - for example, a timeout.  (See below.)


> My question is: is there a method, or a strategy to impose a timeout on the reception of RTSP command response in the liveMedia RTSPClient class ?

Yes, the way to do this is to set up a ‘handler’ function to be called after a timeout interval (of your choice).  This is done using the “TaskScheduler::scheduleDelayedTask()” function.  (There are several examples of this in the code; e.g. in “testProgs/testRTSPClient.cpp”)

Your handler function would then call:
        yourRTSPClient->changeResponseHandler(cseq, NULL);
to cancel the pending request.  “cseq” is the (unsigned) integer value that was returned by your previous call to “sendOptionsCommand()” - i.e.:
        cseq = yourRTSPClient->sendOptionsCommand( … );


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


_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20201210/75ef2a41/attachment.htm>


More information about the live-devel mailing list