<div dir="ltr">I've faced problems using live555 to capture many streams per process.<div>The source is select() calls. It can't accept fd index more than FD_SETSIZE ( 1024 on most distros).</div><div><br></div><div>
I've made some patches to code and i believe it would be useful</div><div>Sorry, if i've choosed wrong way to send a patch, but cannot found right way to post it on site.</div><div><br></div><div>1) GroupsockHelper.cpp :</div>
<div><br></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Block</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">until</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">socket</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">readable</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(with</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">a</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">5-second</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">timeout):</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">#define</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GROUPSOCK_USES_POLL</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">#ifndef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GROUPSOCK_USES_POLL</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>fd_set<span style="color:rgb(192,192,192)"> </span>rd_set<span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>FD_ZERO<span style="color:rgb(0,0,0)">(&</span>rd_set<span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>FD_SET<span style="color:rgb(0,0,0)">((</span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(0,0,0)">)</span>sock<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span>rd_set<span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span>numFds<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span>sock<span style="color:rgb(0,0,0)">+</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">struct</span><span style="color:rgb(192,192,192)"> </span>timeval<span style="color:rgb(192,192,192)"> </span>timeout<span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>timeout<span style="color:rgb(0,0,0)">.</span>tv_sec<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">5</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>timeout<span style="color:rgb(0,0,0)">.</span>tv_usec<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span>result<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span>select<span style="color:rgb(0,0,0)">(</span>numFds<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span>rd_set<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>NULL<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>NULL<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span>timeout<span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span>result<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)"><=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">break</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#else</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">struct</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">pollfd</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">pollFd</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>memset<span style="color:rgb(0,0,0)">(&</span><span style="color:rgb(0,0,0)">pollFd</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(128,128,0)">sizeof</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">pollFd</span><span style="color:rgb(0,0,0)">));</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">pollFd</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">fd</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">sock</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">pollFd</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">events</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">POLLIN</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">|</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">POLLERR</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">result</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">poll</span><span style="color:rgb(0,0,0)">(&</span><span style="color:rgb(0,0,0)">pollFd</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">5000</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">result</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">break</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">#endif</span></pre><div><br></div><div>2) I've made poll()-based task scheduler - how can I post it the best way ?</div>
<div><br></div>-- <br><div dir="ltr">Сергей Куприенко<div>Отдел разработки ПО, "Эф-Эф"</div><div>Sergey Kuprienko<br></div><div>Head of software development dpt.</div><div><br></div></div>
</div></div>