[Red5] Calling a client function only once

Loockas loockas at toras.pl
Sat Dec 27 13:22:35 PST 2008


Hi Paul,
Sorry for that explanation, it wasn't too clear, I'm still new at this
stuff. I didn't mean that function is called twice on each client. I meant
that the server calls this function ONCE on each client, in your example on
A and B, that's twice in total. That's right and it's normal behaviour.
However this results in double displayed message that user C has
disconnected in my chat box on each client. Once for A's connection and once
for B's. Both users see the same message doubled. I'd just like to know how
can I call the removeUser function that will be called only on each client
separately without notifying each other (sending the message to each other
through the server). Or maybe simplier: how can I notify each connected user
that the user C has disconnected?

Paul Tondeur wrote:
> 
> Hi Lukasz,
> 
> I'm not sure if I've understood your problem correctly. This is what I've
> made out of it:
> 
> - Client A connects
> - Client B connects
> - Client C connects
> - Client C disconnect and invokes "removeUser" on client A and B. Only
> this happens twice on each client?
> 
> Calling it twice on each client should not occur. So I'm in doubt if this
> is what you tried to explain.
> 
> Maybe you meant something else. In case client B and C disconnect at
> almost the same time, you'll see that "removeUser" will be invoked twice
> on client A. This is expected to happen. In case you want as less
> communication as possible, you could think of implementing a buffer and
> combine the two disconnects in just one invoke, by sending an array of
> disconnected users.
> Is that where you're looking for?
> 
> Paul
> 
> -----Original Message-----
> From: red5-bounces at osflash.org [mailto:red5-bounces at osflash.org] On Behalf
> Of Loockas
> Sent: zaterdag 27 december 2008 17:21
> To: Red5 at osflash.org
> Subject: [Red5] Calling a client function only once
> 
> 
> Hi, I want the server to call a client function on every connection but
> only
> once. I don't want every client to call this function for every other
> client.
> 
> I have something like this:
> 
> public void appDisconnect( IConnection conn)
> {
>   log.info( "VirtualMC: ClientID " + conn.getClient().getId() + "
> disconnected!" );
>   super.appDisconnect(conn);
>   ServiceUtils.invokeOnAllConnections("removeUser", new Object[]{
> conn.getClient().getId() });
> }
> 
> It results in notifying every client that the exact user was removed but
> it's called for example 2 times if there is 2 more clients connected to
> the
> server after removing the other third one. That's because each of these
> two
> are invoking this removeUser function to each other. How can I solve this?
> 
> -----
> Łukasz Raszyk
> 
> http://devblog.toras.pl http://devblog.toras.pl 
> -- 
> View this message in context:
> http://www.nabble.com/Calling-a-client-function-only-once-tp21185024p21185024.html
> Sent from the Red5 - English mailing list archive at Nabble.com.
> 
> 
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
> 
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
> 
> 


-----
Łukasz Raszyk

http://devblog.toras.pl http://devblog.toras.pl 
-- 
View this message in context: http://www.nabble.com/Calling-a-client-function-only-once-tp21185024p21187777.html
Sent from the Red5 - English mailing list archive at Nabble.com.




More information about the Red5 mailing list