如何检测 Flash 媒体服务器的上传带宽
我正在尝试让“bwcheck”应用程序在 Amazon EC2 上的 FMS 4 上运行,以便检测我到服务器的上传速度并为我的上传速度提供最佳质量的流。
我遵循的教程是这样的:
http://www.derekentringer.com /blog/flash-media-server-streaming-speed-testing-part-2-detect-upload-download-and-latency-speeds-and-port-connection/
或
http://web.archive.org/web/20080308081519/http:// www.peldi.com/blog/archives/2004/01/automatically_c.html
两者几乎相同。但是,当我将 .fla 编译为 .swf(已更改服务器和应用程序的 URL)并且加载服务器端代码后,我在服务器端日志中收到以下错误:
找不到方法 (recData)
我知道显然它没有找到该方法,但我尝试将其从全局范围内的函数中取出,尝试将其附加到客户端等,但没有任何效果。服务器端脚本的原始代码为:
for ( i = 0; i < 1000; i++ ) { 数据+=“S->C”; }
Client.prototype.recData = 函数(数据) { this.ping(); var v = this.getStats(); this.call("ack", 0, v.ping_rtt); }
Client.prototype.echoData = function() { this.call("onEcho", 0, 数据); };
Client.prototype.getBWInfo = function() { 返回 this.getStats(); };
Client.prototype.onConnTimeout = function() { 清除间隔( this.connTimeout ); this.connTimeout = null; application.disconnect(this); }
application.onConnect = 函数(客户端,id) { 跟踪(“连接:”); // 建立连接 application.acceptConnection(客户端); }
I am trying to get the "bwcheck" application to work on FMS 4 on Amazon EC2, in order to detect my upload speed to the server and provide the best quality stream for my upload speed.
The tutorial I follow is this:
http://www.derekentringer.com/blog/flash-media-server-streaming-speed- testing-part-2-detect-upload-download-and-latency-speeds-and-port-conn ection/
or
http://web.archive.org/web/20080308081519/http://www.peldi.com/blog/ar chives/2004/01/automatically_c.html
Both are almost identical. However when I compile the .fla to .swf (having changed the URL for my server and application), and after I load the server-side code, I get the following error in my server-side log:
Method not found (recData)
I understand that apparently it is not finding the method, but I tried getting it off the function in the global scope, tried attaching it to the client, etc. but nothing worked. The original code of the server-side script is:
for ( i = 0; i < 1000; i++ ) {
data += "S->C";
}
Client.prototype.recData = function(data)
{
this.ping();
var v = this.getStats();
this.call("ack", 0, v.ping_rtt);
}
Client.prototype.echoData = function()
{
this.call("onEcho", 0, data);
};
Client.prototype.getBWInfo = function()
{
return this.getStats();
};
Client.prototype.onConnTimeout = function()
{
clearInterval( this.connTimeout );
this.connTimeout = null;
application.disconnect(this);
}
application.onConnect = function(client, id)
{
trace("connect: ");
// Establish the connection
application.acceptConnection(client);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定所有 Client.prototype 方法都位于自己的函数中,即:
该应用程序是否也可以与本地版本的 FMS 一起使用?
Are you sure that all the Client.prototype methods sit within their own function, ie:
Also does the app work with a local version of FMS?
我用相同的代码块解决了这个问题。它在日志中——数据未定义。
把:
var data = ''
放在其他一切之前。
I solved this issue with the same block of code. It's in the logs -- data is undefined.
Put:
var data = ''
Before everything else.