Thanks for your help,
I have already set a callback method and checked the RTMP state to be sure
it's connected.
And I can invoke method from one side :
I have a Red5 server (A) that make a RTMPClient connection on the second
Red5 (B)
When the connection is etablished, from "A", I can call method of "B"
without problems.
But from "B", when the new connection is detected, I can't call methods of
"A".
(and another problem in a previous mail is the parameters are not encoded in
AMF so we can't read them)
There is also a callback to wait on "B" before invoking methods ?
Thanks
2007/3/28, Joachim Bauch <[EMAIL PROTECTED]>:
Hi Guillaume,
Guillaume Lecanu schrieb:
> Can you confirm me the calls methods are supported in the 2 ways (server
> to client and client to server) ?
yep, just tested with the current trunk using the following quick-hack
code:
final RTMPClient client = new RTMPClient();
client.connect("localhost", 1935, "echo", new IPendingServiceCallback() {
public void resultReceived(IPendingServiceCall call) {
System.err.println("Connected: " + call.getResult());
client.invoke("echo", new Object[]{"Hello world!"},
new IPendingServiceCallback() {
public void resultReceived(IPendingServiceCall call) {
System.err.println("Received: " + call.getResult());
}
});
}
});
This results in the following being printed out:
Connected: {level=status, description=Connection succeeded.,
code=NetConnection.Connect.Success}
[WARN] 18422 AnonymousIoService-16:(
org.red5.server.net.rtmp.RTMPClient.warn ) Unhandled ping: Ping: 0, 0, -1,
-1
00 00 00 00 00 00
Received: Hello world!
The "Unhandled ping" comes from the RTMPClient not knowing what to return
to the server for it and can be ignored for now. However the call works
and the result is returned as expected.
One possible problem with your code is, that you invoke the method before
the client connection has been completely established. You should use a
callback method to detect that similar to how it's done in my example.
Joachim
_______________________________________________
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