[Live-devel] Broken RTSP source sometime lead to handler not being called

Ross Finlayson finlayson at live555.com
Sun Jan 26 02:41:36 PST 2020


> So it can be very helpfull to have a deadline timeout for getting command's 
> response (of course with callback being called).

You can cancel a pending RTSP command by calling the function
	RTSPClient::changeResponseHandler(unsigned cseq, responseHandler* newResponseHandler)
(see “liveMedia/include/RTSPClient.h”, line 165)

You would pass this function a “cseq” value that was returned from a previous RTSP “send*Command()” operation (on the same “RTSPClient” object, of course).  The “newResponseHandler” can be NULL; this will cancel the pending command.  (If a response ends up coming back over the network later, then it will just get ignored.)

The best way to set up a ’timeout’ like this is to call “scheduleDelayedTask()”, as you have been doing.  Then your handler can call "changeResponseHandler()”, as noted above.


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




More information about the live-devel mailing list