I have a very robust solution based on some code that I wrote many many moons ago.. simply said. When a client connects you simply create your own "clients" object that contains a reference to the builtin client object. Then when you need to send a private message the client simply passes the id of the person they want the message to go to.. then you just do the call on the id of client which references the object which holds a reference to the correct client object..  so there is no looping going on or the like... very quick.. simple.. and error free.

########################################

application.>>  clientObj = new Object();
> }
>
> application. newClient) {
> // increase unique clientid by 1
> var uid = this.clientId++;
> // give this client a unique id
> newClient.uid = uid;
> clientObj[newClient.uid] = newClient;
> this.acceptConnection( newClient );
> }
> }
>
> Then you could reference the client based on uid like so:
>
> clientObj[uid].call( "privateChat", null, infoToClient);


########################################

Jake

On 5/25/06, Tom Krcha <[EMAIL PROTECTED]> wrote:
Hi maze,

>>> Why would it be too much CPU demanding using the client
connection.call() ? <<<

Well, for private text for 10 users ... it's okay :)

But I have build with colleagues system of four FMS servers, which is now
used by more than 5000 clients in one time - and then you have to take in
mind CPU & memory usage.

Another example:
I have built another drawing module for VideoChat - and it's done
unfortunately using NC.call. When you open server taskmgr - you just see how
CPU is jumping, when users are drawing.
For this it should be made using streams.

Tom Krcha


_______________________________________________
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