[Live-devel] non blocking sockets

Ross Finlayson finlayson at live555.com
Wed Dec 6 11:01:41 PST 2006


>This problem is due to the accept() function in 
>RTSPServer::incomingConnectionHandler1(). It 
>returns only blocking sockets even if the main 
>socket is not blocking. I solved the problem 
>setting as NONBLOCK the socket after the 
>accept() call
 it seems to work. Do you think 
>that my solution can cause other uncontrolled 
>mishaps?

No, I think your solution here is absolutely 
correct.  I will include it in the next release 
of the code.


>Moreover,  a problem about blocking socket it 
>seems to be also in the RTSPClient. In this case 
>too, I need to use RTPOverTCP connection. In 
>RTSPClient::openConnectionFromURL() is called 
>the setupStreamSocket() with the third argument 
>(i.e. makeNonBlocking) set to False. Is this a 
>free choice or must I keep this setting?

No, because "RTSPClient" currently reads its 
responses synchronously, its socket must be 
blocking.  (Having "RTSPClient" read its 
responses synchronously is probably a design 
flaw, because it prevents having multiple clients 
- or a client and a server - running in the same 
event loop.  This will probably get fixed 
someday...)
-- 

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



More information about the live-devel mailing list