Flex 3.4 和 FMS 3.5.1 - 在 RTMP 调用上发送 ByteArray 时出现问题
我在我的机器上安装了 FMS 3.5,并使用 main.asc 创建了一个新应用程序,如下所示:
application.onAppStart = function()
{
/* Allow debugging */
this.allowDebug = true;
}
//Client is connected
application.onConnect = function( client )
{
//Accept the connection
application.acceptConnection( client );
client.allo = function(o) {
trace("test : " + o ) ;
trace("length : " + o.length ) ;
trace("objectEncoding : " + o.objectEncoding ) ;
return o ;
}
}
//Client disconnected
application.onDisconnect = function( client )
{
//Trace on the FMS Application console
trace( client+" is disconnected" );
}
此代码准备了一个我用我的 Flex 应用程序调用的函数,名为“allo”,它返回相同的 byteArray 作为响应。
弹性代码是:
var anotherArray:ByteArray = new ByteArray();
anotherArray.objectEncoding = ObjectEncoding.AMF3;
anotherArray.writeObject(new String("foo"));
nconn.call(func, echoResponder, anotherArray);
结果,我得到一个空的 ByteArray,只有长度、编码、字节序和位置参数。 tcpdump 跟踪显示 ByteArray 为空。
所以我想知道是否只是发送了一个指针,或者可能是我配置错误了。
您知道进一步调查或解决此问题的方法吗?
感谢您的帮助,
国会议员
I installed a FMS 3.5 on my machine and created a new application with main.asc like this :
application.onAppStart = function()
{
/* Allow debugging */
this.allowDebug = true;
}
//Client is connected
application.onConnect = function( client )
{
//Accept the connection
application.acceptConnection( client );
client.allo = function(o) {
trace("test : " + o ) ;
trace("length : " + o.length ) ;
trace("objectEncoding : " + o.objectEncoding ) ;
return o ;
}
}
//Client disconnected
application.onDisconnect = function( client )
{
//Trace on the FMS Application console
trace( client+" is disconnected" );
}
This code prepare a function I call with my flex application, named "allo" and it returns the same byteArray in response.
The flex code is :
var anotherArray:ByteArray = new ByteArray();
anotherArray.objectEncoding = ObjectEncoding.AMF3;
anotherArray.writeObject(new String("foo"));
nconn.call(func, echoResponder, anotherArray);
As a result, I get an empty ByteArray with only length,encoding, endian and position parameters. And a tcpdump trace shows that the ByteArray is empty.
So I wonder if it's only a pointer which is sent, or maybe I misconfigured something.
Do you know a way to investigate further or solve this ?
Thanks for any help,
MP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我试过你的代码。
发送...
...并接收...
跟踪
foo
我认为你的代码没问题。唯一的区别是我使用 FMS 4。
I tried your code.
Sending...
... and receiving...
traces
foo
I think your code is OK. Only difference is that I use FMS 4.