<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Got it. Thank you Ross,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Massimo</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> live-devel <live-devel-bounces@us.live555.com> on behalf of Ross Finlayson <finlayson@live555.com><br>
<b>Sent:</b> Thursday, December 10, 2020 1:31 PM<br>
<b>To:</b> LIVE555 Streaming Media - development & use <live-devel@us.live555.com><br>
<b>Subject:</b> Re: [Live-devel] Timeout on reception of RTSP commands</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
> On Dec 10, 2020, at 10:01 PM, Massimo Perrone via live-devel <live-devel@us.live555.com> wrote:<br>
> <br>
> 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.<br>
> In such a case, the livemedia RTSPClient hangs up until the server responds or close the connection.<br>
<br>
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.)<br>
<br>
<br>
> 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 ?<br>
<br>
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”)<br>
<br>
Your handler function would then call:<br>
yourRTSPClient->changeResponseHandler(cseq, NULL);<br>
to cancel the pending request. “cseq” is the (unsigned) integer value that was returned by your previous call to “sendOptionsCommand()” - i.e.:<br>
cseq = yourRTSPClient->sendOptionsCommand( … );<br>
<br>
<br>
Ross Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/">http://www.live555.com/</a><br>
<br>
<br>
_______________________________________________<br>
live-devel mailing list<br>
live-devel@lists.live555.com<br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
</div>
</span></font></div>
</body>
</html>