flex端的脚本代码是这样的:
//初使连接
private var nc:NetConnection;
public function init():void{
nc= new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, _statusHandler);
nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _securityHandler);
nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, _asyncHandler);
nc.connect("rtmp://localhost/test");
}
public function testcall():void{
nc.call("frommxml",new Responder(callResult,callFault),"大哥",“大姐");
}
private function callResult():void{
}
private function callFault():void{
}
//test方法由red5来调用
public function test(arg:String){
Alert.show(arg);
}
red5端的代码是:
public void frommxml(String gg,String mm){
IConnection ic = Red5.getConnectionLocal();
if (ic instanceof IServiceCapableConnection){
IServiceCapableConnection sc = (IServiceCapableConnection) ic;
sc.invoke("test",new Object[]{"调用客户端方法"});
}
}
与出错无关的函数我就不列出来了,以上代码在运行时客户端能够调用red5的"frommxml"方法,但red5调客户端的"test"方法时客户端却没反映,
而且客户端去处理AsyncErrorEvent.ASYNC_ERROR事件,不知道是什么原因引起这个问题,请哪位大侠帮帮小弟!
FLEX与red5互调出现异步错误?请各位兄弟姐妹们帮帮忙!
最新推荐文章于 2022-04-28 21:50:25 发布