P2P(Peer to Peer)项目设计的sample传送视频流

来源:互联网 发布:淘宝雷锋侠在哪申请 编辑:程序博客网 时间:2024/06/16 18:54

P2P(Peer to Peer)项目设计的sample传送视频流(xxxx )

基于OPen Source P2P框架圖



Open Source Solution 初步實例




步骤1:STB need to download a torrent file of the movie
from HTTP server.
步驟2:STB parse the torrent file, then connects to the tracker
And gets the IP list of the uploading peers.
步驟3:STB connects to the uploading peers for download,
after the piece download finished. The peer start
uploading.
詳細實例看下面步驟

實例示意圖


步驟1


步驟2


步驟3


Start to download piece


所需要准備的open source
libsigc++-2.0
curl-7.24.0
https://launchpad.net/ubuntu/+source/libsigc++-2.0/2.2.10-0ubuntu2
http://curl.haxx.se/download.html
Libtorrent-0.12.6
xbt_tracker
rtorrent-0.8.6
http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.6.tar.gz
http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz
LIBRARY DEPENDENCIES
libsigc++ 2.0 (deb: libsigc++-2.0-dev)
G++ >= 3.3
GNU m4
Commad line:
apt-get install m4
./configure –-disable openssl
Make
Make install
DEPENDENCIES
libcurl >= 7.12.0
ncurses(maybe we don't need at last^_^)
command line:
apt-get install ncurses-dev
./configure
make
cd /src/
gedit .rtorrent.rc
./rtorrent
http://xbtt.sourceforge.net/tracker/
DEPENDENCIES
apt-get install cmake g++ libboost-date-time-dev libboost-dev
libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev
libboost-serialization-dev libmysqlclient15-dev
make subversion zlib1g-dev
Command line:
./make.sh
./xbt_tracker
中間可能會遇到些問題:
可能問題1:mysql install 的問題,可以查看目錄下xbt_tracker.sql,xbt_tracker.conf 建立
好xbt 的database.
可能問題2:修改config.cpp --- "auto_register", &m_auto_register, true,
mktorrent
http://mktorrent.sourceforge.net/
Cygwin Command line:
Make
./mktorrent.exe -l 16 -a http://123.com,http://234.com ./test/1.txt
You will generate the torrent file of 1.txt
使用Rtorrent搭建P2P player期待解決的問題
1,Rtorrent 需要按Pieces(1)...Pieces(N)順序傳輸
2,修改xbt_tracker,去除mysql,libboost
......

原创粉丝点击