OpenRTMFP/Cumulus Primer(1)入門介紹與部署CumulusServer
OpenRTMFP/Cumulus Primer(1)入門介紹與部署CumulusServer
- 作者:柳大·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 準備工作
下載:
External Dependencies | Official Site | Windows | Linux/OSX |
---|---|---|---|
OpenSSL | Official Site | Download | Download |
Lua | Official Site | Download | Download |
POCO | Official Site | Download | Download |
注意:
- POCO for linux: 版本必須是 1.4.0 或更高,否則會引起 TCP 相關的 bug。
3 安裝
3.1 外部依賴的安裝
Windows 下略,Linux 下基本就是:
./configure
make
sudo make install
3.2 安裝 OpenRTMFP/Cumulus
OpenRTMFP-Cumulus/CumulusLib
make
cd ../CumulusServer
make
如果出現了.h
檔案、lib 庫找不到的情況,請修改 OpenRTMFP-Cumulus/CumulusLib/Makefile 或 OpenRTMFP-Cumulus/CumulusServer/Makefile。
4 配置
通過編寫OpenRTMFP-Cumulus/CumulusServer/CumulusServer.ini
檔案來為 OpenRTMFP-Cumulus 進行個性化配置(預設是沒有這個檔案的),這個檔案的內容形如:
;CumulusServer.ini
port = 1985
udpBufferSize = 114688
keepAlivePeer = 10
keepAliveServer = 15
[logs]
name=log
directory=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.lua
rtmfp://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(5)CumulusServer啟動流程分析(續1)Server
- OpenRTMFP/Cumulus Primer(4)CumulusServer啟動流程分析Server
- OpenRTMFP/Cumulus Primer(5)CumulusServer啟動流程分析(續)Server
- OpenRTMFP/Cumulus Primer(8)CumulusServer主程式主迴圈分析Server
- OpenRTMFP/Cumulus Primer(6)CumulusServer啟動流程分析(續2)Server
- OpenRTMFP/Cumulus Primer(7)CumulusServer啟動流程分析(續3)Server
- OpenRTMFP/Cumulus Primer(7)CumulusServer 啟動流程分析(續3)Server
- OpenRTMFP/Cumulus Primer(2)用Lua編寫HelloWorld應用擴充套件CumulusServer套件Server
- OpenRTMFP/Cumulus Primer(17)AMF解析之AMFReader(續1)
- OpenRTMFP/Cumulus Primer(16)AMF解析之AMFReader
- OpenRTMFP/Cumulus Primer(14)AMF解析之PacketReader/Writer
- OpenRTMFP/Cumulus Primer(18)AMF解析之AMFReader(續2)
- OpenRTMFP/Cumulus Primer(9)AMF解析之BinaryReader/Writer
- OpenRTMFP/Cumulus Primer(15)AMF解析之資料型別定義資料型別
- OpenRTMFP/Cumulus Primer(9)AMF 處理方式解析——BinaryReader/Writer
- OpenRTMFP/Cumulus Primer(13)IO管理之區域性記憶體片記憶體
- Kubeflow實戰: 入門介紹與部署實踐
- OpenRTMFP/Cumulus Primer(19)獨立使用CumulusLib時的執行緒安全Bug執行緒
- StackStorm 介紹與入門ORM
- seata入門介紹與seata-service部署與驗證(一)
- OpenRTMFP/Cumulus Primer(21)經由伺服器的釋出/訂閱流程的關鍵點伺服器
- OpenRTMFP/Cumulus Primer(23)執行緒邏輯分析之二:RTMFPManager對RTMFPServer的影響執行緒Server
- day01-Mybatis介紹與入門MyBatis
- DG學習筆記(1)_入門介紹筆記
- Java API——RMIIO入門教程(1)基本介紹JavaAPI
- OpenRTMFP/Cumulus Primer(22)執行緒邏輯分析之一:RTMFPServer執行緒的啟動和等待執行緒Server
- Nginx 入門介紹Nginx
- Django 入門介紹Django
- rollup入門介紹
- Tmux 入門介紹UX
- Mybatis 入門介紹MyBatis
- Rocketmq 入門介紹MQ
- Vue入門到關門之Vue介紹與使用Vue
- libevent入門介紹
- linux介紹(入門)Linux
- GCD入門介紹一GC
- LNMP架構介紹與部署LNMP架構
- 機器學習入門之sklearn介紹機器學習