[Live-devel] openRTSP

Ross Finlayson finlayson at live555.com
Sat Feb 27 09:29:47 PST 2010


>I did not ran into the limit of sockets per thread but using netstat, I
>found out that sometimes two pairs of sockets used the same RTP and RTCP
>port numbers.

It's the server that decides what port numbers are used for RTP and 
RTCP for each stream.  If RTP and/or RTCP port numbers are being 
reused, then that appears to be a bug in your server.  (Our RTSP 
server code should not be doing this, so I hope your server is not 
using our code.)


>Also, in the MediaSubsession::initiate(int useSpecialRTPoffset) function
>only the pointer value of fRT(C)PSocket is checked after the creation of a
>Groupsock object. But if the socket creation call returns -1 in the
>constructor, the program will continue using the invalid socket handle.
>Apart from the pointer value of fRT(C)PSocket, the value of fSocketNum
>should be checked.

Yes, you're probably right.


>A last remark in the MediaSubsession::initiate(int useSpecialRTPoffset)
>function: I noticed that when the user does not specify a start port value
>(fClientsPortNum) sockets are created and checked if they are bound to an
>even port. If they don't they are added to a socketHashTable and a new
>socket is created until successful. Why not just create two sockets and
>trying to bind them to a given port number, just as is done when the user
>actually does give a start port number

Because that's not what we want to do.  Instead, we want the 
operating system to chose a port number for itself (this is, by 
convention, called an "ephemeral port number").  We just have to make 
sure that even port numbers are used for RTP.
-- 

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


More information about the live-devel mailing list