[Live-devel] Adding multiple sources

Ross Finlayson finlayson at live555.com
Mon Apr 3 07:41:28 PDT 2006


>I thought about overriding doEventLoop in a class derived from 
>BasicTaskScheduler. But someone gave me a better idea.
>
>The idea is creating a socket that will serve as request sink. When 
>a new source or sink needs to be added a message is sent to the 
>socket (request sink) and the select called by NextStep exits 
>(because request sink is readable). When a message on the socket is 
>received it handles it and creates new sink or source according to 
>received message data.
>
>The socket can be opened as UDP because it will receive messages 
>over local loop (so no chance data is lost).
>
>Am I on the right track here ?

Yes, it's perfectly reasonable to use incoming data on a socket as a 
message 'event'.  This is supported directly within the "LIVE555 
Streaming Media" libraries (using 
"TaskScheduler::turnOnBackgroundReadHandling()").

However, a simpler solution - if the messages are to originate within 
the same address space (process) as the LIVE555 thread - is to use 
the 'watchVariable' feature, as illustrated in 
<http://lists.live555.com/pipermail/live-devel/2005-September/003276.html>. 
Note that the 'watchVariable' is a char, giving you 255 non-zero 
values to use for messages.


	Ross Finlayson
	Live Networks, Inc. (LIVE555.COM)
	<http://www.live555.com/>



More information about the live-devel mailing list