Assuming this is an rtmp connection.

You can use the magic red5 utility object.

Red5 r5 = new Red();
r5.getConnection();
r5.getClient()
...

Or access only the connection via the static method..
IConnection conn = Red5.getConnectionLocal();
conn.getClient();

The current connection is stored in a thread local so you can use it in a handler or service.
This only works for rtmp connections at the moment.

-- Luke

On 5/3/06, sobluesky <[EMAIL PROTECTED]> wrote:
 
 
this sample works, but in the Application.add,  is there a way to know which client is calling this method?
 
 
 
 

Sample handler
==========================
 
A sample handler can be implemented in a few lines of code::
 
    package the.path.to.my;
   
    import org.red5.server.adapter.ApplicationAdapter;
   
    public class Application extends ApplicationAdapter {
       
        public Double add(Double a, Double b){
            return a + b;
        }
   
    }
 
Assuming the sample configuration above, you can call this method using the
following ActionScript snippet::
 
    nc = new NetConnection();
    nc.connect("rtmp://localhost/myapp");
    nc. {
        trace("The result is " + obj);
    }
    nc.call("add", nc, 1, 2);
 
This should give you the output::
 
    The result is 3

_______________________________________________
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