OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer
来源:互联网 发布:贵阳数据分析师培训 编辑:程序博客网 时间:2024/05/16 04:53
- 作者:柳大·Poechant
- 博客:Blog.csdn.net/poechant
- 邮箱:zhongchao.ustc@gmail.com
- 日期:April 10th, 2012
1 背景介绍
OpenRTMFP 可以帮助你实现 Flash 的实时应用的高并发扩展,OpenRTMFP/Cumulus 是基于 GNU General Public License 的。
- OpenRTMFP: Real Time Media Flow Protocol
- POCO: POrtable COmponents,是一个强大的开源 C++ 库。其在 C++ 开发中的角色,相当于 Java Class Library、苹果的 Cocoa、.NET framework。
2 准备工作
下载:
注意:
- POCO for linux: 版本必须是 1.4.0 或更高,否则会引起 TCP 相关的 bug。
3 安装
3.1 外部依赖的安装
Windows 下略,Linux 下基本就是:
./configuremakesudo make install或者sudo apt-get install libssl-dev libpoco-dev liblua5.1-0-dev
3.2 安装 OpenRTMFP/Cumulus
OpenRTMFP-Cumulus/CumulusLibmakecd ../CumulusServermake
如果出现了.h
文件、lib 库找不到的情况,请修改 OpenRTMFP-Cumulus/CumulusLib/Makefile 或 OpenRTMFP-Cumulus/CumulusServer/Makefile。
1. 错误“./sources/Script.h:30:25: 错误:lua5.1/lua.h:没有那个文件或目录”
解决办法:把lua5.1/lua.h修改为<lua.h>,编辑Makefile,把-llua5.1修改为-llua
2. 编译成功,但运行时发生错误“error while loading shared libraries: libPocoFoundation.so.12”
解决办法:运行 export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
4 配置
通过编写OpenRTMFP-Cumulus/CumulusServer/CumulusServer.ini
文件来为 OpenRTMFP-Cumulus 进行个性化配置(默认是没有这个文件的),这个文件的内容形如:
;CumulusServer.iniport = 1985 udpBufferSize = 114688keepAlivePeer = 10keepAliveServer = 15[logs]name=logdirectory=C:/CumulusServer/logs
一些字段的设置含义如下,摘自:地址
- 公开给 Client 的端口号:
port
, equals 1935 by default (RTMFP server default port), it’s the port used by CumulusServer to listen incoming RTMFP requests. - UDP 缓冲区字节数:
udpBufferSize
, allows to change the size in bytes of UDP reception and sending buffer. Increases this value if your operating system has a default value too lower for important loads. keepAliveServer
, time in seconds for periodically sending packets keep-alive with server, 15s by default (valid value is from 5s to 255s).keepAlivePeer
, time in seconds for periodically sending packets keep-alive between peers, 10s by default (valid value is from 5s to 255s).edges.activated
, activate or not the edges server on the RTMFP server (see CumulusEdge, Scalability page for more details about CumulusEdge). By default, CumulusServer stays a RTMFP server without edges ability (default value is false).edges.port
, port for the edges server, to accept incoming new CumulusEdge instances (see CumulusEdge, Scalability page for more details about CumulusEdge). By default, it’s the port 1936.Warning: This port will receive plain text request from edges, for this purpose it should not be made public. It’s very important for security consideration. It must be available only for CumulusEdge instances, and anything else.
edges.attemptsBeforeFallback
, number of CumulusEdge attempt connections before falling back to CumulusServer (see CumulusEdge, Scalability page for more details about CumulusEdge). By default the value is 2 (in practical, 2 attempts happens after 5 sec approximately).smtp.host
, configure a SMTP host to use mails feature provided by Cumulus in server application (see Server Application, Sockets page for more details about mails feature). By default the value is localhost.smtp.port
, configure a SMTP port to use mails feature provided by Cumulus in server application (see Server Application, Sockets page for more details about mails feature). By default the value is 25.smtp.timeout
, configure a SMTP timeout session in seconds to use mails feature provided by Cumulus in server application (see Server Application, Sockets page for more details about mails feature). By default the value is 60 seconds.- 日志路径:
logs.directory
, directory where are written log files (CumulusServer/logs by default). - 日志文件名称:
logs.name
, name of log file (log by default).
5 启动
Windows 下的启动方法为:
CumulusServer.exe /registerService [/displayName=CumulusServer /description="Open Source RTMFP Server" /startup=automatic]
Unix-like 下的启动方法为:
sudo ./CumulusServer --daemon [--pidfile=/var/run/CumulusServer.pid]
如我的启动命令为:
sudo ./CumulusServer --daemon --pidfile=./CumulusServer.pid
6 基本使用
本地 Flash client 可以通过如下语句连接:
var nc:NetConnection = new NetConnection();nc.connect("rtmfp://localhost/");
RTMFP
默认是采用1935
端口,如果你特别指定了其他端口,比如12345
,请使用如下方式:
nc.connect("rtmfp://localhost:12345/");
7 扩展 CumulusServer——Server Application
启动CumulusServer
后,会在可执行文件的目录下出现一个www
目录,该目录的作用,就是作为 Server Application 的默认根目录。具体的对应关系如下:
rtmfp://host:port/ -> [CumulusServer folder]/www/main.lua (root application)rtmfp://host:port/myApplication -> [CumulusServer folder]/www/myApplication/main.luartmfp://host:port/Games/myGame -> [CumulusServer folder]/www/Games/myGame/main.lua
另外要提醒的是,如果main.lua
文件被修改,则不需要重启CumulusServer
,因为 Server Application 的创建是一种动态的方式。
CumulusServer 的详细扩展方式会在下一篇文章中介绍。
-
转载请注明来自柳大的CSDN博客:Blog.csdn.net/poechant
-
- OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer
- OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer
- OpenRTMFP/Cumulus Primer(4)CumulusServer启动流程分析
- OpenRTMFP/Cumulus Primer(4)CumulusServer启动流程分析
- OpenRTMFP/Cumulus Primer(5)CumulusServer启动流程分析(续1)
- OpenRTMFP/Cumulus Primer(5)CumulusServer启动流程分析(续1)
- OpenRTMFP/Cumulus Primer(6)CumulusServer启动流程分析(续2)
- OpenRTMFP/Cumulus Primer(7)CumulusServer启动流程分析(续3)
- OpenRTMFP/Cumulus Primer(6)CumulusServer启动流程分析(续2)
- OpenRTMFP/Cumulus Primer(7)CumulusServer 启动流程分析(续3)
- OpenRTMFP/Cumulus Primer(2)用Lua编写HelloWorld应用扩展CumulusServer
- OpenRTMFP/Cumulus Primer(8)CumulusServer主进程主循环分析
- OpenRTMFP/Cumulus Primer(2)用Lua编写HelloWorld应用扩展CumulusServer
- OpenRTMFP/Cumulus Primer(8)CumulusServer主进程主循环分析
- OpenRTMFP/Cumulus开发笔记(1) 部署Cumulus
- OpenRTMFP/Cumulus Primer 入门(3)图解CumulusEdge原理
- OpenRTMFP/Cumulus Primer(17)AMF解析之AMFReader(续1)
- OpenRTMFP/Cumulus Primer(3)图解CumulusEdge原理
- Android SDK 离线包
- Java报表工具finereport注册并发查看与原理
- MySQL 架构 - MySQL 存储引擎 - 其他存储引擎
- P2P原理NAT附源码
- XPath 函数
- OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer
- 命令行运行Hbase: Session 0x0 for server null, unexpected error
- 酒店英语——比扬口语分享
- 第一次的亲密接触C++上机报告
- 国内java报表软件对比
- [TYVJ-1195] DP
- 我的第一个C++上机报告(简单输出)
- 我和C++的第一次亲密接触 mytest
- 第一个c++上机报告