package {

     import flash.display.Sprite;
import flash.net.NetConnection;
import flash.events.NetStatusEvent;
import flash.events.AsyncErrorEvent; /**
* @author Frost.Yen
* @E-mail 871979853@qq.com
* @create 2015-7-16 上午10:02:15
*
*/
public class BandwidthCheck extends Sprite
{
private var _nc:NetConnection; public function BandwidthCheck()
{
_nc = new NetConnection();
_nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
_nc.client = new Client();
_nc.connect("rtmp://localhost/bandwidthcheck");
} public function netStatusHandler(event:NetStatusEvent):void
{
trace(event.info.code);
switch (event.info.code)
{
case "NetConnection.Connect.Success":
// 调用服务器上的本地带宽检测代码。您不需要编写任何服务器端代码。
_nc.call("checkBandwidth", null);
break;
}
} public function asyncErrorHandler(event:AsyncErrorEvent):void
{ }
}
} class Client {
public function onBWCheck(... rest):Number {
return 0;
}
public function onBWDone(... rest):void {
var bandwidthTotal:Number;
if (rest.length > 0){
bandwidthTotal = rest[0];
trace("Bandwith from server to client is: " + bandwidthTotal + " Kbps");
}
}
}

[ActionSprit 3.0] FMS服务器带宽检测的更多相关文章

  1. 视频FMS服务器带宽成本分析

    一.现状 调查了一下,主要有两种主流方式,WebRTC或者Flash. 1. WebRTC(不支持IE浏览器,已排除):网页实时通信(英语:Web Real-Time Communication)的缩 ...

  2. [ActionSprit 3.0] FMS直播

    音视频流的发布(服务端) package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash ...

  3. [ActionSprit 3.0] FMS安装与测试

    1.运行Flash Media Server4.5.exe,安装选项可全默认,序列号可不填:输入用户名和密码需记住,登录时要用. 2.安装完成,在安装目录C:\Program Files\Adobe\ ...

  4. [ActionSprit 3.0] FMS客户端调用服务器端命令或方法

    有时候客户端需要和服务器端进行通信,服务器端会有个main.asc文件(当然,文件名可以自己定义),这个就是服务器端程序,是在服务器上执行的,你可以用trace调试,trace的内容会在管理服务器的页 ...

  5. [ActionSprit 3.0] FMS客户端与服务器端交互(传参)

    客户端as: import flash.net.NetConnection; import flash.events.NetStatusEvent; var nc:NetConnection = ne ...

  6. [ActionSprit 3.0] FMS远程共享

    package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.SyncE ...

  7. [ActionSprit 3.0] FMS接收正在播放的视频中嵌入的描述性信息(onMetaData事件)

    package { import flash.display.MovieClip; import flash.net.NetConnection; import flash.events.NetSta ...

  8. FMS 客户端带宽计算、带宽限制

    FMS 客户端带宽计算.带宽限制 1. 带宽计算 FMS内置了带宽检测的特性(被称作"native bandwidth detection"),要进行带宽检测,客户端只要在成功连接 ...

  9. rtmp一些状态信息详解-as连接FMS服务器报错状态汇总~~

    原地址:http://help.adobe.com/zh_CN/AIR/1.5/jslr/flash/events/NetStatusEvent.html 下表说明了 code 和 level 属性可 ...

随机推荐

  1. Nginx源码完全注释(7)ngx_palloc.h/ngx_palloc.c

    ngx_palloc.h /* * NGX_MAX_ALLOC_FROM_POOL should be (ngx_pagesize - 1), i.e. 4095 on x86. * On Windo ...

  2. Quaternion.identity是什么意思?

    Quaternion.identity就是指Quaternion(0,0,0,0),

  3. iOS 10 适配 ATS(app支持https通过App Store审核)

    iOS 10 适配 ATS 一. HTTPS 其实HTTPS从最终的数据解析的角度,与HTTP没有任何的区别,HTTPS就是将HTTP协议数据包放到SSL/TSL层加密后,在TCP/IP层组成IP数据 ...

  4. Java 面试知识点汇总

    OOP:(Object Oriented Programming )面向对象编程 重用性.灵活性和扩展性 高内聚.低耦合 面向过程编程与面向对象编程的区别:举例,自己做饭吃与去饭馆吃,去饭馆只需要知道 ...

  5. eclipse (android环境搭建)

    如何安装java环境 http://jingyan.baidu.com/article/a24b33cd59b58e19fe002bb9.html eclipse安装教程 http://jingyan ...

  6. Windows下搭建JSP开发环境

    1. 配置说明: => 编辑器: Eclipse (Java EE IDE) => 数据库: MySQL (MySQL Workbench 进行数据库管理, 用 MySQL Connect ...

  7. mysql 添加字段,修改字段的用法

    1.添加字段 ALTER TABLE 表明 add 字段名称 类型(int,char,VARCHAR...) DEFAULT 默认值  位置(FIRST, AFTER+字段名称); 2.删除 ALTE ...

  8. Locality preserving hashing for fast image search: theory and applications

    Is there any Java library that provides an implementation (or several) of a Locality Preserving Hash ...

  9. _I、_O、_IO的含义

    转自:http://blog.csdn.net/daa20/article/details/42339695 __I. __O .__IO是什么意思? 这是ST库里面的宏定义,定义如下: #defin ...

  10. CF869C The Intriguing Obsession(组合数学瞎搞,O(n)莫名过)

    — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii ...