<HTML>
<HEAD>
<TITLE>Re: [Live-devel] setupDatagramSocket - SO_REUSEADDR problems</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
I tried an experiment running 2 openRTSP processes in the testProgs folder. They connected to the same URL (an Axis Camera), and they both used the same client_ports. The server handled the connection on different ports, but the client_port reported in the Transport Section were the same.<BR>
<BR>
Should this be the case on separate processes?<BR>
<BR>
Stuart<BR>
<BR>
On 3/10/09 6:56 PM, "Ross Finlayson" <<a href="finlayson@live555.com">finlayson@live555.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>>Hi,<BR>
>I've found that in some cases (it seems to be random) the method<BR>
>mediaSubsession::initiate will use the same UDP ports for both a<BR>
>video stream and an audio stream. A sample output for the openRTSP<BR>
>program is the following:<BR>
><BR>
><BR>
>Created receiver for "video/MP4V-ES" subsession (client ports 34394-34395)<BR>
>Created receiver for "audio/PCMU" subsession (client ports 34394-34395)<BR>
>Setup "video/MP4V-ES" subsession (client ports 34394-34395)<BR>
>Setup "audio/PCMU" subsession (client ports 34394-34395)<BR>
><BR>
><BR>
>The problem seems to be the SO_REUSEPORT socket option on the<BR>
>setupDatagramSocket function.<BR>
>So, my question is: Is it safe to disable that option?<BR>
<BR>
The SO_REUSEPORT option is intended to allow more than one process -<BR>
on the same host - to use the same (explicit) socket number. For<BR>
example, it allows more than one application to receive the same<BR>
multicast stream, or, in the case of a unicast stream, it allows a<BR>
different process to receive it than the actual RTSP client (e.g.,<BR>
the "-r" option to "openRTSP"). It should not be allowing the OS to<BR>
hand out the same ephemeral port number more than once. If your OS<BR>
is doing this, then it may be buggy.<BR>
<BR>
If you're not anticpating any other process on the client host from<BR>
receiving the stream, then you could probably get away with not<BR>
setting SO_REUSEPORT. However, fixing your buggy OS is probably the<BR>
better option :-)<BR>
<BR>
--<BR>
<BR>
Ross Finlayson<BR>
Live Networks, Inc.<BR>
<a href="http://www.live555.com/">http://www.live555.com/</a><BR>
_______________________________________________<BR>
live-devel mailing list<BR>
<a href="live-devel@lists.live555.com">live-devel@lists.live555.com</a><BR>
<a href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
<BR>
- ------------------------------------------------------------------------------<BR>
Confidentiality Notice: The information contained in this transmission is legally privileged and confidential, intended only for the use of the individual(s) or entities named above. This email and any files transmitted with it are the property of Pelco. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you receive this communication in error, please notify us immediately by telephone call to +1-559-292-1981 or forward the e-mail to administrator@pelco.com and then permanently delete the e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation. <BR>
- ------------------------------------------------------------------------------<BR>
</BODY>
</HTML>