[Live-devel] RTP/RTCP data reading - subsequent select() calls

Ross Finlayson finlayson at live.com
Thu Nov 25 14:33:10 PST 2004

>In BasicTaskScheduler::SingleStep(), the select() call provide us with
>the list of readable sockets. Then, a
>MultiFramedRTPSource::networkReadHandler() call is done for each
>readable socket.
>Why is there a new subsequent call to select() in blockUntilReadable()
>for each MultiFramedRTPSource::networkReadHandler() ?

In the case you've noted, in this case (because we know that the socket is 
immediately readable) the extra call to select() is actually superfluous 
(but, on the other hand, does no harm).  In some other situations, though, 
you want to do a blocking read on a socket that might not currently be 
readable.  To simplify the code, the call to "blockUntilReadable()" is done 
in all cases.

	Ross Finlayson

More information about the live-devel mailing list