如何检测 Flash 媒体服务器的上传带宽

发布于 2024-11-14 00:56:29 字数 1405 浏览 7 评论 0原文

我正在尝试让“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮色兮凉城 2024-11-21 00:56:29

您确定所有 Client.prototype 方法都位于自己的函数中,即:

application.onAppStart = function (info){

    ////////// start bandwidth check methods ////////////////
    for ( i = 0; i < 500; i++ ) {
    data += "S->C";
}

Client.prototype.recData = function(data) 
{
    this.ping();
    var v = this.getStats();
    this.call("ack", 0, v.ping_rtt);
}
...etc
    ////////// end bandwidth check methods ////////////////
}

application.onConnect = function(client_obj, id) {
    application.acceptConnection(client_obj);
} 

该应用程序是否也可以与本地版本的 FMS 一起使用?

Are you sure that all the Client.prototype methods sit within their own function, ie:

application.onAppStart = function (info){

    ////////// start bandwidth check methods ////////////////
    for ( i = 0; i < 500; i++ ) {
    data += "S->C";
}

Client.prototype.recData = function(data) 
{
    this.ping();
    var v = this.getStats();
    this.call("ack", 0, v.ping_rtt);
}
...etc
    ////////// end bandwidth check methods ////////////////
}

application.onConnect = function(client_obj, id) {
    application.acceptConnection(client_obj);
} 

Also does the app work with a local version of FMS?

暗地喜欢 2024-11-21 00:56:29

我用相同的代码块解决了这个问题。它在日志中——数据未定义。

把:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文