[Red5] About presence status

John Grden neoriley at gmail.com
Tue Nov 14 11:49:13 EST 2006


red5 does/can let the clients know when someone disconnects.  One of the
apps actually has that in there - I beleive it's "test" that has that code.
but I can't remember

On 11/14/06, Rob Koch <robcube at gmail.com> wrote:
>
> Red5 broadcasts who joins and their updated status (Away, Available,
> etc..), but not when someone logs off.
>
> Seems there still needs a bit more work in the presence part, am I right?
>
> -rob
>
> On 11/14/06, . m a r c o s   a u g u s t o <chadart at gmail.com> wrote:
> > Hi guys,
> >
> > I'm trying to keep track of who is joining and leaving, so I tought
> about
> > two functions for my app, "addUser" , "removeUser"...
> > I'm lost in my Application.java .. to broadcast those events to who is
> > connected. if someone can help, the code follows.
> > btw, I'm using Red5's appLeave event for disconnection cuz was the only
> who
> > seems to work now, i'm using trunk
> > How I don't know java I just pasted the newstream event cuz it looked
> more
> > like what I need..heheh but don't work...
> >
> >
> >     public boolean appJoin(IClient client, IScope scope) {
> >         log.info("Client joined app " + client.getId());
> >         // If you need the connecion object you can access it via.
> >     //    IConnection conn = Red5.getConnectionLocal();
> >         Iterator<IConnection> it = scope.getConnections();
> >
> >         while (it.hasNext()) {
> >             IConnection conn = it.next();
> > //            if (conn.equals(current)) {
> > //                // Don't notify current client
> > //                continue;
> > //            }
> >
> >             if (conn instanceof IServiceCapableConnection) {
> >                 IServiceCapableConnection service =
> > (IServiceCapableConnection) conn;
> >                 service.invoke("addId",
> >                         new Object[] { conn.getClient().getId() },
> this);
> >                 if (log.isDebugEnabled()) {
> >                     log.debug("sending notification to " + conn);
> >                 }
> >             }
> >         }
> >         return true;
> >     }
> >
> >
> >
> >
> >
> >     public void appLeave(IClient client, IScope scope){
> >
> >     //    IServiceCapableConnection service =
> (IServiceCapableConnection)
> > conn;
> >         log.info("Client DISjoined app " + client.getId());
> >         IConnection current = Red5.getConnectionLocal();
> >         Iterator<IConnection> it = scope.getConnections();
> >         while (it.hasNext ()) {
> >             IConnection conn = it.next();
> >             if (conn.equals(current)) {
> >                 // Don't notify current client
> >                 continue;
> >             }
> >
> >             if (conn instanceof IServiceCapableConnection) {
> >                 ((IServiceCapableConnection) conn).invoke("removeId",
> >                         new Object[] { conn.getClient().getId() },
> this);
> >                 if (log.isDebugEnabled()) {
> >                     log.debug("sending notification to " + conn);
> >                 }
> >             }
> >         }
> >
> >
> >
> > --
> > . m a r c o s    a u g u s t o  ;
> >
> > .e onde houver fé, que eu leve a dúvida.
> > _______________________________________________
> > Red5 mailing list
> > Red5 at osflash.org
> > http://osflash.org/mailman/listinfo/red5_osflash.org
> >
> >
> >
>
>
> --
> 800-757-0689
> http://seerobcode.com
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>



-- 
[  JPG  ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20061114/ba2c302a/attachment.htm


More information about the Red5 mailing list