I see, your solution is actually pretty similiar to mine. Except in my
application, its a voice chat which uses push-to-talk kind of
interface. So when the user pushes the button, he broadcasts an audio
stream. What I did was similiar to you. I create a new connection each
time a user needs to broadcast a stream and the same is done on the
client side and shut down the connection with conn.close()
netstream.close() each time the conversation is over. But doing these
makes things slower and take up server resources because it requires
twice the number of connections.

I was messing around the source code trying to fix the problem myself
and I notice that the MAX_STREAM variable was in an old build of the
RTMP.java file in the codecs but its removed in recent builds.

I also took at look at the reserveStreamId function and and used the
log file to examine the output of the server when streams are
created/destroyed. It seems to me that streams sometimes do not get
unreserved before they get deleted, which cause new streams to be able
to only reserve streamId that is progressively bigger until it run
into the MAX_STREAMS limit. I tried to mess with the code but so far
only succeeded in crashing Red5.

Keep us updated on your findings. Thanks!

On 1/2/07, Branko Pecnik <[EMAIL PROTECTED]> wrote:
> Hi NK
>
> Yes, my site is down. I have a live webvideochat on MFS, which I must switch
> on again becouse I found some errors on my Red5 webvideochat.
>
> I didn't touch the server side code just Application class. It's like it is,
> but on client side, when client connect, it create new NetConnection and
> connect with conn.connect. This connection is permanent as long as the
> client is connected and is used for communication with applicaton.java I use
> connection.calls to let clients now that smomeone connected. When client
> receive the call I create new NetConnection in Subscriber class and create a
> stream stream = new Stream(conn). And when Subscriber disconnect I make a
> conn.close(), and delete the subscriber class.
>
> Thats all. I intend to set MAX_STREAMS to very low value eg. 1 or 2 if I use
> it just videoconnverence.
>
> Brane
>
> -----Izvirno sporočilo-----
> Od: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namesto
> Nankun Huang
> Poslano: 3. januar 2007 3:58
> Za: [email protected]
> Zadeva: Re: [Red5] There is a BUG.
>
> Hi Brane,
>      Your website is down. Your solution sounds very interesting. I
> have been working on a workaround of my own and it goes something like
> this:
>
> When a client connects to the server, I create 3 connections (
> IConnection Objects )
>
> 1, this object maintains the connection and state
> 2, this object takes care of broadcasting the streams from client
> 3, this object takes care of receiving and playing streams from the server
>
> Because the limitation of 12 streams is on both the broadcasting side
> ( through ns.publish ) and on the playing side (through ns.play ), I
> have to keep the 2 separate connections. When one connection runs out
> of streams ( I keep an index to keep track of how many streams each
> connection has played), I create a new connection object and reset the
> stream index.
>
> I'm wondering how you are able to use just ONE connection object to
> create streams by itself? what commands are you using on the server
> side to create these streams?
>
> Thanks and I hope they fix this bug soon because it greatly limits
> red5's ability.
>
> NK
>
>
> On 1/2/07, Branko Pecnik <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Hello!
> >
> >
> >
> > I workarounds this limitation on streams in this ugly way. This is
> temporary
> > solution in mean time, when the profs fix this error. They will, I hope
> so.
> >
> >
> >
> > Solution:
> >
> > When new user (subscriber) connected, I create a new connecton for him and
> > through this connection create new stream.
> >
> > When subscriber disconnected, I close this connection too.
> >
> >
> >
> > You can see a live example of video chat on my site.
> >
> > http://www.planka.net/Vchat/Prijava.html
> >
> > Register with valid email.
> >
> >
> >
> > Any comments and sugestions ?
> >
> >
> >
> > Brane
> >
> >
> >
> >
> >
> >
> >
> >  ________________________________
> >
> >
> > Od: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namesto
> > Branko Pecnik
> >  Poslano: 29. december 2006 22:01
> >  Za: [email protected]
> >  Zadeva: Re: [Red5] There is a BUG.
> >
> >
> >
> >
> > Ok, I think I found the problem.
> >
> > Between client's connect and disconnect every new stream created get the
> > next id number (1,2,3,...,10,11,12,13 …) Even the earlier stream is
> deleted
> > the next one get next id in a sequence. For example, if client create 3
> > streams (ids are 1, 2 and 3) and then deleted them, the next new stream
> get
> > the id number equal 4. On server side is a class RTMPConnection, with this
> > declarations:
> >
> >
> >
> >             private final static int MAX_STREAMS = 12;
> >
> >
> >
> >             //private Context context;
> >
> >             private Channel[] channels = new Channel[64];
> >
> >             private IStream[] streams = new IStream[MAX_STREAMS];
> >
> >             private boolean[] reservedStreams = new boolean[MAX_STREAMS];
> >
> >
> >
> > Some methods in this class have controll if streamId is less then 12, and
> if
> > not, the stream is rejected. StreamID is used as an index for accessing
> the
> > values of those arrays.
> >
> >
> >
> > Is this is a bug or not it's depend of type of application. For
> > videoconference it is (after 11-th person disconnected, no stream is
> > availble). I think this is an answer for a lot of mails in this mailing
> > list. Someone have to reprogram RTMPConnection class, but not just
> > increasing MAX_STREAMS.
> >
> > If no one does, I will L.
> >
> >
> >
> > Tell me please, how to compile server side src.
> >
> >
> >
> > Brane
> >
> >
> >
> >
> >
> >
> >
> >  ________________________________
> >
> >
> > Od: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namesto
> > Branko Pecnik
> >  Poslano: 29. december 2006 18:20
> >  Za: [email protected]
> >  Zadeva: Re: [Red5] Is there a limit number of streams in NetConnection
> oris
> > aBUG ?
> >
> >
> >
> > Hi.
> >
> > It's me again. Nobody answer me L. The simple question is: How many
> streams
> > is posible through one NetConnection. I can make 11 working streams. Is
> any
> > body out there which make more then eleven ?
> >
> >
> >
> > Brane
> >
> >
> >
> >  ________________________________
> >
> >
> > Od: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namesto
> > Branko Pecnik
> >  Poslano: 28. december 2006 21:36
> >  Za: [email protected]
> >  Zadeva: [Red5] Is there a limit number of streams in NetConnection or is
> > aBUG ?
> >
> >
> >
> > Hi.
> >
> > At first sorry for my bad english, but I hope you will understand me.
> >
> > I'm working on videoconference application. It working fine but after a
> few
> > concurent disconnects and connects of clients the new streams on client
> side
> > stop  working. So I done some tests and figure out that after executing
> > 12-th statement:
> >
> >
> >
> > stream = new Stream(p_connection);
> >
> >
> >
> > the new stream not working, and server after every next this statement
> write
> > to log this two lines:
> >
> >
> >
> >  [WARN] 108563 IoWorker-4:(
> > org.red5.server.net.rtmp.RTMPHandler.warn ) Unhandled ping:
> > Ping: 3, 0, 0, -1
> >
> >  00 03 00 00 00 00 00 00 00 00
> >
> >
> >
> > I think that server is stil working fine after this event, becouse the
> other
> > clients witch connected later see each other just fine.
> >
> >
> >
> >
> >
> > The other test was making the 12 same sequential statements like this:
> >
> >
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> > stream = new Stream(p_connection);
> >
> >
> >
> > and the  stream not worked. If I write 11 statements stream work fine. ?!
> >
> >
> >
> > Can any one test the same 12 statements and report me the result PLEASE?
> >
> >
> >
> > I developing on WinXP with Red5-0.5, but if I copy .swf on Linux Suse 10.1
> > where using red5 0.6 and a couple of days old trunk all is the same.
> >
> >
> >
> > Thanks guys for a help
> >
> > Brane
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >  __________ NOD32 1942 (20061228) Information __________
> >
> >  This message was checked by NOD32 antivirus system.
> >  http://www.eset.com
> >
> >
> >
> >  __________ NOD32 1945 (20061229) Information __________
> >
> >  This message was checked by NOD32 antivirus system.
> >  http://www.eset.com
> >
> >
> >
> >  __________ NOD32 1945 (20061229) Information __________
> >
> >  This message was checked by NOD32 antivirus system.
> >  http://www.eset.com
> > _______________________________________________
> > Red5 mailing list
> > [email protected]
> > http://osflash.org/mailman/listinfo/red5_osflash.org
> >
> >
> >
>
> _______________________________________________
> Red5 mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>
>
> _______________________________________________
> Red5 mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to