[Live-devel] Problem using live555MediaServer with more than 250 clients
PROMONET Michel
michel.promonet at thalesgroup.com
Wed Dec 10 09:11:34 PST 2014
Hi Ross,
Thanks for your answer.
Sorry for asking for some additional explanations, but there is something I do not understand in your answer.
socket() can give a number above FD_SETSIZE (FD_SETSIZE is a limit for fd_set used by select(), but is not related to socket()).
This can be easily verified with a piece of code like this :
for (int i=0; i<2048; i++)
printf(“%d\n”, socket(AF_INET,SOCK_DGRAM,0));
Increasing ‘ulimit –n 4096’ will allow to sockets with number up to 2051 (stdin, stdout, stderr + 2048 sockets)
What I missed ?
Thanks & Regards,
Michel.
[@@ THALES GROUP INTERNAL @@]
De : live-devel [mailto:live-devel-bounces at ns.live555.com] De la part de Ross Finlayson
Envoyé : mercredi 10 décembre 2014 15:20
À : LIVE555 Streaming Media - development & use
Objet : Re: [Live-devel] Problem using live555MediaServer with more than 250 clients
In order to avoid to reach the abort, I try an extra sanity check inside BasicTaskScheduler::setBackgroundHandling
void BasicTaskScheduler::setBackgroundHandling(int socketNum, int conditionSet, BackgroundHandlerProc* handlerrProc, void * clientData) {
if ( (socketNum <0) || (socketNum >= FD_SETSIZE) ) return;
…
Maybe, but I’m not convinced that this would really be useful, as the current code should already make sure (at a higher level) that “setBackgroundHandling()” (or “turnOnBackgroundReadHandling()”, which calls “setBackgroundHandling()”) does not get called with a socket number <0. Also, it should never get called with a socket number >= FD_SETSIZE, because socket numbers this large should never have been given out (i.e., returned as a result of a “socket()” call) in the first place!
Also, let me remind people once again that the number of sockets used by each stream can be reduced from 2 (RTP,RTCP) to 1 (RTP-muxed-with-RTCP) if both the server and client support this; see
http://lists.live555.com/pipermail/live-devel/2014-March/018179.html
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141210/f986e6c7/attachment.html>
More information about the live-devel
mailing list