We were trying to do all this inside the Application.java, so we'll start looking into it in more like the way you have outlined here.
Thanks!
Leif
On 6/28/06,
m.j.milicevic <[EMAIL PROTECTED]> wrote:
Hi Leif,
I was testing some stuff few days ago, and it works for me
(I am using latest/greatest version from trunk):
here snippets from my application (simplified, hibernate etc stuff removed):
1) create class that contains something like this:
public class SimpleHandler implements IPendingServiceCallback {
public void getUsers() {
List<String> users = new ArrayList<String>();
users.add("m.j.milicevic");
users.add("other user");
users.add("another user");
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IServiceCapableConnection) {
IServiceCapableConnection sc = (IServiceCapableConnection) conn;
// this is a callback, see flash code below:
sc.invoke("receiveUsers", new Object[]{users});
}
}
// interface method...
public void resultReceived(IPendingServiceCall call) {
}
}
2) regsiter your handler within webapps/yourapp/red5-web.xml (note: change package)
<bean id="simplehandler.service" class=" org.red5.web.handler.SimpleHandler" singleton="true" />
3)boot your app and call it from flash, e.g.:
nc.connect("rtmp://localhost/dbexample");
nc.call("simplehandler.getUsers ", nc);
nc.receiveUsers = function(users, args)
{
trace("got users"+users);
}
Also, there was tutorial somwhere how to do this (I believe video)
which had some more information, please check red5 site links..
hth,
kind regards,
-m.j.milicevic
----- Original Message -----
From: "Leif Wells" <[EMAIL PROTECTED]>
To: < [email protected]>
Sent: Wednesday, June 28, 2006 11:33 PM
Subject: [Red5] Result Handlers in RTMP Calls
> (Sorry for the previous note... Gmail got me again!)
>
> What I am trying to do is have a NetConnection object pass a result handler
> to Red5.
>
> I am calling to Red5 like so:
>
> nc.call("getTeachers", Delegate.create(this, onGetTeachersResult),
> sessionId, classroomId);
>
> and adding:
>
> public function onGetTeachersResult(teachers:Array):Void
> {
> trace("onGetTeachersResult: length: " + teachers.length);
> }
>
> In Java, I am doing something like this:
>
> public List<User> getTeachers( String classroomId, String sessionId ) {
>
> return teachers;
> }
>
> I believe that this works on FMS, but I am not getting anything back from
> the server built from the .5 unstable build. Am I doing something wrong? Has
> something not been implemented? Thoughts?
>
--------------------------------------------------------------------------------
> _______________________________________________
> 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
