存档

2009年6月 的存档

今天完成了Red5通讯框架并测试通过

2009年6月29日 admin 6 条评论

先看看下面介绍,更多功能将在下个版本更新.

版本:
v0.1

主要功能:
1,客戶端任意CALL服務端,反之亦然
2,實現消息轉發,Application所有事件分發.
3,運用反射實現服務的動態查找.
4,對客戶端發送的ByteArray進行解包及封裝.
5,服務端CALL客戶端(單CALL和廣播)
6,所有數據傳遞都採用基於AMF的二進制流

Popularity: unranked [?]

Sql智能提示

2009年6月25日 admin 没有评论

其实就是 SQL Assistant 工具,
支持SqlServer,Visual Studio
,MySql,Oracle
看看 以下截图:

sql2
sql1

DB

下载地址:SQL Assistant2.516 (内含注册码)

Popularity: unranked [?]

ThinkPad SL300 SL400 SL500 Vista Ultimate 32位SP1 中文简体系统恢复光盘

2009年6月14日 admin 没有评论

最好使用迅雷下载,直接在下载点右键-使用迅雷就可以,速度很快!!

1.ThinkPad SL300 SL400 SL500 Vista Ultimate 32位中文简体系统恢复光盘 1of4 212.82MB        下载

2.ThinkPad SL300 SL400 SL500 Vista Ultimate 32位中文简体系统恢复光盘 2of4 2.67GB            下载

3.ThinkPad SL300 SL400 SL500 Vista Ultimate 32位中文简体系统恢复光盘 3of4 4.12GB            下载

4.ThinkPad SL300 SL400 SL500 Vista Ultimate 32位中文简体系统恢复光盘 4of4 144.25MB        下载

安装注意事项:

1.充分估计安装时间,系统整个安装过程需要近3个小时!所以,一定要有耐心,找个有充分时间的时候进行安装!下载后的文件刻录的时候一定要选择“刻录镜像文件”,如果使用的是刻录数据DVD,那就不能自动读取了!这点一定要注意,刻录速度尽量要慢些!
2.首先,将光盘的第一个盘放入(一定要按照下载时候的文件那几个顺序,最后标记一下!)(212.82MB是第一个,2G多那个是第二个,4G多那个是第三个,剩下的那个是第四个),重启电脑,在进入系统前按下F12,选择第二个选项(从光驱启动)。
3.等待一会,进入如下语言选择界面,选择简体中文就可以了!接着就是接受条款,然后点击下一步!

4.最关键的地方到了,看好下面这张图,这个时候一定要点“是”,否则,你是无法安装成功的,这是与SL自己刻录的系统恢复盘有区别的,不要按照网上很多SL自己刻录的系统恢复盘的使用方法来安装这个系统!否则,会误入歧途的!
thinkpad
5.接下来会提示,放入第一张CD,然后放入以后,点击“确定”;等待…..,提示“放入驱动和….盘”就依次放入下一张并点击“确定/是”,读完第二张再放第三张,到第四张放完,还会有提示说:如果有一张补充恢复盘请插入。这个时候点击“取消/否”就可以了!然后等待系统倒计时,自动进入系统复制阶段!
6.以后的事情几乎都是电脑自己的事情了,你可以去看看电视,或者忙自己的事情,因为等待的时间会让你无法忍受的,很漫长,漫长到你认为电脑是不是死机了?这个时候,你只要看到硬盘等还在闪,你就大可以放心的等待!以后还会出现很多次DOS界面,而且会重启很多次,千万不要认为电脑是不是死机了,然后手动就关机,再开了!那你就完蛋了!
7.等到,电脑的蓝色画面出现了,是不是很兴奋?但是,你还是需要很长时间来让电脑完成最后工序的!总之,除了一些简单设置以外,以后都是电脑自己的事情了,你只需要给你的电脑3个小时!就可以看到一个崭新的系统了!

Popularity: 5% [?]

Red5群集

2009年6月11日 admin 没有评论

首先看看官方文档介绍:

Various Clustering Configurations to Meet Various Usage Scenarios

Minimal Configuration and Quick Setup
Experimental System or Testing System
Play around
Large Concurrence with Medium Size Client Interaction
Education System
Large Concurrence with Big Size Client Interaction
Large Online Gaming

red5-qj-1
 

The minimal configuration is for quick server cluster setup. What you need is just pick a generic HTTP load balancer (Hardware or software) and configure the Red5 server to run on Terracotta.
The Terracotta Server is used to manage the Terracotta cluster.

red5-qj-2
 

This framework can support a large amount of concurrent connections with the medium size client interaction (which means the amount of connections that share a RSO or join in a Live conference is not very big).
Edge Server is used to manage connections. The actual requests from client will be multiplexed and forwarded to Origin Server in which the requests are actually served.
The Edge Servers run on Terracotta and clustered while Origin Server runs separately. The request is balanced per URL patterns. So different applications can run on different Origin Servers, or different sub-functions in one application can run on different Origin Servers (thus load-balancing is achieved).
Eg., for a Live conference application, say the URL is at App/Lobby/Room1, the Edge Server will route the request to a specific Origin, thus the conference is held on that Origin.
red5-qj-3
 
If the concurrent interaction requirement is mandatory, say in a big online gaming where the amount of concurrent connections that connect to the same RSO is large, a Origin Server clustering solution is needed.
The diagram above is different from the last diagram in that the Origin Servers run on Terracotta so that a specific RSO can be shared across the cluster.
The link between Edge and Origin could be cross link or a load-balancer. The load-balancer is preferred as in this case there should be no difference to connect Origin Server A or Origin Server B.

上面的论述,其实配置文件中都有说明,看配置文件就一目了然。

Red5的开发人员太伟大了!!!

 

Popularity: 7% [?]

分类: JAVA 标签: ,

ActionScript进制之间转换

2009年6月11日 admin 没有评论

先来看看下面的代码:
var str:String=”a”;
var strResult:String = str.charCodeAt().toString(2);
var intResult=parseInt(strResult,2);
var strFinal=String.fromCharCode(intResult);
trace(strResult);
trace(intResult);
trace(strFinal);

结果如下:

1100001
97
a

分析程序:

var str:String=”a”;

// 定义一个字符串

var strResult:String = str.charCodeAt().toString(2);

//将该字符串的ASCII码ToString(2)得到二进制数,就得到 1100001

var intResult=parseInt(strResult,2);

//再把这个二进制转换成十进制,得到结果97   ,97就是a的 ASCII码

var strFinal=String.fromCharCode(intResult);

//将ASCII转成字符串            8)

parseInt的详细介绍如下:

parseInt 函数

parseInt(expression:String, [radix:Number]) : Number

将字符串转换为整数。如果参数中指定的字符串不能转换为数字,则此函数返回 NaN。以 0x 开头的字符串被解释为十六进制数字。以 0 开头的整数或指定基数为 8 的整数被解释为八进制数字。有效整数前面的空白将被忽略,有效整数后面的非数字字符也将被忽略。

可用性:ActionScript 1.0、Flash Player 5

参数

expression:String ─ 要转换为整数的字符串。

radix:Number [可选] ─ 表示要分析的数字的基数(基)的整数。合法值为 2 到 36。

返回

Number ─ 一个数字或 NaN(非数字)。

示例

这一节中的示例使用 parseInt() 函数计算各种类型的数字。

下面的示例返回 3:

parseInt("3.5")

下面的示例返回 NaN

parseInt("bar")

下面的示例返回 4:

parseInt("4foo")

下面的示例说明返回 1016 的十六进制转换:

parseInt("0x3F8")

下面的示例演示使用可选的 radix 参数且返回 1000 的十六进制转换:

parseInt("3E8", 16)

以下示例说明二进制转换并返回 10,10 是二进制 1010 的十进制表示形式:

parseInt("1010", 2)

以下示例说明八进制数字分析并返回 511,511 是八进制 777 的十进制表示形式:

parseInt("0777")
parseInt("777", 8 )

Popularity: 6% [?]

由于另一个程序或正在运行的服务可能正在使用网络地址转换组件(Ipnat.sys)

2009年6月9日 admin 没有评论

今天在服务器上遇到了这个问题,在CSDN上也没找到解决方法,

后来自己解决了,步骤如下:

1, 开始–>管理工具–>服务 找到Windows Firewall/Internet Connection Sharing (ICS) 并启动这个服务

2,开始–>控制面板–>Windows防火墙   启动就可以了.

Popularity: 10% [?]

Red5 0.8.1正式版发布

2009年6月8日 admin 6 条评论

用了2天了,感觉还是挺不错的,增加了许多新功能,

例如: 支持H.264 ,支持1080P等

一些新特性在这里就不介绍了,直接到官方下载.

http://code.google.com/p/red5/

Popularity: 15% [?]

Red5实现直播

2009年6月8日 admin 2 条评论

程序如下:

发布端(Publish):

var nc:NetConnection = new NetConnection();
 
nc.connect("rtmp://125.67.234.97/Red5Stream");
nc.addEventListener(NetStatusEvent.NET_STATUS,connectHandler);
 
function connectHandler(par:NetStatusEvent):void {
    
trace(par.info.code);   
    
var camera:Camera = Camera.getCamera();
    
camera.setQuality(163854,100);
        
    
var stream:NetStream = new NetStream(nc);
    
stream.attachCamera(camera);
    
stream.publish("red5");
}

接收端

package {
    
import flash.display.*;
    
import flash.utils.*;
    
import flash.events.*;
    
import flash.net.*;
    
import flash.media.Video;
    
import fl.data.DataProvider;
    
import flash.media.Camera;
 
    
public class NetStreamTestDocument extends Sprite {
        
var nc:NetConnection;
        
public function NetStreamTestDocument() {
            
nc= new NetConnection();
            
nc.connect("rtmp://125.67.234.97/Red5Stream");
            
nc.addEventListener(NetStatusEvent.NET_STATUS,connectHandler);
            
            
        
}
        
public function connectHandler(par:NetStatusEvent):void {
            
var ns:NetStream = new NetStream(nc);
            
var video:Video=new Video(320,240) ;
                    
video.attachNetStream(ns);
            
ns.play("red5");
            
addChild(video);
        
}
    
}
}

服务端:

package com.conjs;
 
import org.red5.server.adapter.MultiThreadedApplicationAdapter;
import org.red5.server.api.IConnection;
import org.red5.server.api.Red5;
import org.red5.server.api.stream.IBroadcastStream;
import org.red5.server.api.stream.IStreamCapableConnection;
import org.red5.server.api.stream.support.SimpleConnectionBWConfig;
 
public class OtherApplication extends MultiThreadedApplicationAdapter {
    @
Override
    
public void streamPublishStart(IBroadcastStream stream) {
        
IConnection conn=Red5.getConnectionLocal();
        
measureBandwidth(conn);
        
if (conn instanceof IStreamCapableConnection) {
            
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
            
SimpleConnectionBWConfig bwConfig = new SimpleConnectionBWConfig();
            
bwConfig.getChannelBandwidth()[3] = 1048576L;
 
            
bwConfig.getChannelInitialBurst()[3] = 131072L;
 
            
streamConn.setBandwidthConfigure(bwConfig);
 
            
super.streamPublishStart(stream);
        
}
    
}
 
    @
Override
    
public void streamBroadcastClose(IBroadcastStream arg0) {
        
super.streamBroadcastClose(arg0);
    
}
 
}

以下是官方在 H.264 和 1080P 方面支持的Demo ,我没有测试过,代码如下:

package org.red5.demos.oflaDemo;
import org.red5.server.adapter.ApplicationAdapter;
import org.red5.server.api.IBandwidthConfigure;
import org.red5.server.api.IConnection;
import org.red5.server.api.IScope;
import org.red5.server.api.stream.IServerStream;
import org.red5.server.api.stream.IStreamCapableConnection;
import org.red5.server.api.stream.support.SimpleConnectionBWConfig;
 
public class Application extends ApplicationAdapter {
    
    
private IScope appScope;
    
private IServerStream serverStream;
 
    
public boolean appStart(IScope app) {
        
appScope = app;
        
return true;
    
}
 
    
public boolean appConnect(IConnection conn, Object[] params) {
        
measureBandwidth(conn);
        
if (conn instanceof IStreamCapableConnection) {
            
SimpleConnectionBWConfig bwConfig = new SimpleConnectionBWConfig();
            
bwConfig.getChannelBandwidth()[IBandwidthConfigure.OVERALL_CHANNEL] =
                
1024 * 1024;
            
bwConfig.getChannelInitialBurst()[IBandwidthConfigure.OVERALL_CHANNEL] =
                
128 * 1024;
            
bwConfig.setUpstreamBandwidth(1024 * 1024);
        
}         
        
return super.appConnect(conn, params);
    
}
 
    
public void appDisconnect(IConnection conn) {
        
if (appScope == conn.getScope() && serverStream != null) {
            
serverStream.close();
        
}
        
super.appDisconnect(conn);
    
}
}

Popularity: 26% [?]

分类: JAVA, Red5 标签: ,

Red5 Client 调用 Red5 Server

2009年6月5日 admin 没有评论
package com.conjs;

import org.red5.server.api.service.IPendingServiceCall;
import org.red5.server.api.service.IPendingServiceCallback;
import org.red5.server.net.rtmp.RTMPClient;

public class Red5 extends RTMPClient {
public static void main(String[] args) {
String host = "localhost";
String app = "test";
int port = 1935;
final Red5 client = new Red5();

IPendingServiceCallback callback = new IPendingServiceCallback() {
@SuppressWarnings("unchecked")
public void resultReceived(IPendingServiceCall call) {
java.util.Map<String, String> re = (java.util.Map<String, String>) call.getResult();
System.out.println("level:" + re.get("level"));
System.out.println("description:" + re.get("description"));
System.out.println("code:" + re.get("code"));
}
};
client.connect(host, port, app, callback);
}

}

Popularity: 14% [?]

在IIS6配置PHP5

2009年6月4日 admin 2 条评论

今天在网上看了教程,一步一步配置都不成功,郁闷了半天。 决定写下 成功配置步骤

1,到PHP官方下载最新PHP包(我这里用PHP压缩包,不是MSI)

2,解压到C:\PHP下,将php.ini-dist 改名为 PHP.INI,将extension_dir = “C\php\ext”.(PHP.INI中相关其他参数根据自己需要修改)

3,在 WINDOWS 中加入环境变量

3.1, PATH : 追加 C:\php;C:\php\ext

3.2,新建  PHPRC  值 为  C:\php

4,在IIS的WEB服务 扩展中 添加 php5isapi.dll

5,配置IIS:

5.1 新建站点,主目录–>配置—>添加扩展名为PHP,DLL引用 php5isapi.dll

5.2 ISAPI筛选器—>添加 选择 php5isapi.dll

到这里已经配置完成,预览网站就能看到效果。

Popularity: 5% [?]

分类: PHP 标签: