[Live-devel] Related to -> non blocking sockets

Ross Finlayson finlayson at live555.com
Wed Dec 6 17:21:55 PST 2006


>Yes! I discovered that the combination of having a single thread
>application, a blocking RTSP client, and RTSP server in the same
>application is not going to work so well if the RTSP client contacts the
>RTSP server in the same application (or I think an RTSP server that is
>unavailable).  The client gets stuck waiting for the server to respond, but
>the server can never receive the message because the event loop never moves
>forward after the client read.
>
>(Of course it is odd to contact RTSP server in your own application

No kidding.

This is a perfect example of a situation where you could/should use 
multiple threads - i.e., run your RTSP server in a separate thread 
(with its own UsageEnvironment, etc. - see the FAQ).  This should 
work OK because the only communication between the RTSP client and 
the RTSP server is (or at least, should be, if your application is 
well-designed) via RTSP/RTP (i.e., sockets).

Alternatively, spawn and run the RTSP server as a separate *process*, 
which is even safer.

>Do you have a better idea than callbacks?

Yes, see above.
-- 

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


More information about the live-devel mailing list