OpenRTMFP/Cumulus Primer(2)用Lua编写HelloWorld应用扩展CumulusServer
2012-09-29 16:48
856 查看
作者:柳大·Poechant
博客:Blog.csdn.net/poechant
邮箱:zhongchao.ustc@gmail.com
日期:April 10th, 2012
建议先了解一下Server Application,然后继续。下面的这个实例是在本地(Client与Server位于同一机器上)测试的。
获取 Developer Key 的地址:
服务器配置信息:
编写服务器段应用地址:
快去试试吧 :)
-
转载请注明来自柳大的CSDN博客:Blog.csdn.net/poechant
-
博客:Blog.csdn.net/poechant
邮箱:zhongchao.ustc@gmail.com
日期:April 10th, 2012
建议先了解一下Server Application,然后继续。下面的这个实例是在本地(Client与Server位于同一机器上)测试的。
1 Server-side
1.1 Server configuration:
; CumulusServer.ini port = 1935 udpBufferSize = 114688 keepAlivePeer = 10 keepAliveServer = 15 [logs] name = log directory = logs
1.2 Application file:
-- CumulusServer/www/main.lua function onConnection(client,response,...) function client:test(...) name,firstname = unpack(arg) return "Hello "..firstname.." "..name end end
2 Client-side
// CumulusClient.as package { import flash.display.Sprite; import flash.net.NetConnection; import flash.net.NetStream; import flash.net.Responder; public class CumulusClient extends Sprite { private var nc:NetConnection = null; private var ns:NetStream = null; public function CumulusClient() { nc = new NetConnection(); nc.connect("rtmfp://localhost"); nc.client = this; nc.call("test",new Responder(onResult,onStatus), "OpenRTMFP/Cumulus", "World") } public function close():void { nc.close(); } public function onStatus(status:Object):void { trace(status.description) } public function onResult(response:Object):void { trace(response) // expected to display "Hello World OpenRTMFP/Cumulus" } } }
3 运行结果
Hello World OpenRTMFP/Cumulus [SWF] CumulusClient.swf - 解压缩后为 1,776 个字节 [卸装 SWF] CumulusClient.swf
4 远程测试:一个免费的测试服务器
获取 Developer Key 的地址:http://108.59.252.39:8080/CumulusServer/index.jsp
服务器配置信息:
Server: amd64 OS: Linux 2.6.18-028stab095.1 Server IP: 108.59.252.39 OpenRTMFP as of: 22.Feb.2012
编写服务器段应用地址:
http://108.59.252.39:8080/CumulusServer/manage_ssls.jsp
快去试试吧 :)
-
转载请注明来自柳大的CSDN博客:Blog.csdn.net/poechant
-
相关文章推荐
- OpenRTMFP/Cumulus Primer(2)用Lua编写HelloWorld应用扩展CumulusServer
- OpenRTMFP/Cumulus Primer(8)CumulusServer主进程主循环分析
- OpenRTMFP/Cumulus Primer(22)线程逻辑分析之一:RTMFPServer线程的启动和等待
- OpenRTMFP/Cumulus Primer(23)线程逻辑分析之二:RTMFPManager对RTMFPServer的影响
- OpenRTMFP/Cumulus Primer(5)CumulusServer启动流程分析(续1)
- OpenRTMFP/Cumulus Primer(4)CumulusServer启动流程分析
- OpenRTMFP/Cumulus Primer(8)CumulusServer主进程主循环分析
- OpenRTMFP/Cumulus Primer(4)CumulusServer启动流程分析
- OpenRTMFP/Cumulus Primer(5)CumulusServer启动流程分析(续1)
- OpenRTMFP/Cumulus Primer(6)CumulusServer启动流程分析(续2)
- OpenRTMFP/Cumulus Primer(6)CumulusServer启动流程分析(续2)
- OpenRTMFP/Cumulus Primer(7)CumulusServer启动流程分析(续3)
- OpenRTMFP/Cumulus Primer(7)CumulusServer 启动流程分析(续3)
- OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer
- OpenRTMFP/Cumulus Primer(11)IO 管理之IO流
- OpenRTMFP/Cumulus Primer(9)AMF解析之BinaryReader/Writer
- OpenRTMFP/Cumulus Primer(12)IO管理之IO流(续)
- OpenRTMFP/Cumulus Primer(16)AMF解析之AMFReader
- OpenRTMFP/Cumulus Primer(21)经由服务器的发布/订阅流程的关键点
- OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer