Openrtmfp/Cumulus primer (2) Compile helloworld application extension cumulusserver with Lua
- Author: Liu Da-poechant
- Blog: blog.csdn.net/poechant
- Email: zhongchao.ustc@gmail.com
- Date: 10000l 10Th, 2012
The following instance is tested locally (the client and server are located on the same machine.
1 Server-side1.1 Server Configuration:
; CumulusServer.ini port = 1935udpBufferSize = 114688keepAlivePeer = 10keepAliveServer = 15[logs]name = logdirectory = logs
1.2 application file:
function onConnection(client,response,...) function client:test(...) name,firstname = unpack(arg) return "Hello "..firstname.." "..name endend
2 client-side
// CumulusClient.aspackage { 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. Running result
Hello World openrtmfp/Cumulus [SWF] cumulusclient.swf-1,776 bytes after decompression [unload SWF] cumulusclient.swf
4 Remote Test: a free test Server
Obtain the developer Key address:
http://108.59.252.39:8080/CumulusServer/index.jsp
Server configuration information:
Server: amd64 OS: Linux 2.6.18-028stab095.1Server IP: 108.59.252.39OpenRTMFP as of: 22.Feb.2012
Write the server segment application address:
http://108.59.252.39:8080/CumulusServer/manage_ssls.jsp
Try it.
-
Reprinted, please indicate the csdn blog from LIU Da: blog.csdn.net/poechant
-