mini-BitTorrent

https://github.com/darshank15/Mini-BitTorrent
fork一個有趣的專案
https://github.com/x213212/Mini-BitTorrent
新增了檔案切割和重組,遇到來源中斷也可以切換source,新增進度條
,基本上如果tracker做成搜尋的樣子(不難,實現一個foxy 也是蠻好玩

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

整體流程就是跟一般bt差不多,client 上傳檔案分享,tracker 的seederlist 會記錄各個client傳送過來的種子檔(紀錄client要分享的檔案位置和port),當有另外一個client想下載檔案,client就會詢問tracker 然後 tracker在把seederlist可用的cleint在傳給使用者。
目前改動傳輸的檔案不再是單一檔案,類似可以中斷下載,這樣後續如果各個分割檔案都分享出去,那麼就不再侷限只能分享一個檔案,可以分享一個檔案的chunk ,這樣檔案來源應該不容易死。
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

所以download我寫成分割檔
也寫了一個merge
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

原本download沒有進度顯示我也加了進度條和merge binary 總byte 的部分,和下載速率.
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

實測確實binary合併後可以正確執行.
新增了檔案校驗的md5檢查,本來想選crc32的,後來發現作者本來就有引用openssl的lib

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

切換來源如何準確找出我想要的resource.
有新增了md5我們就可以從tracker的來源中挑出md5有符合的source
新增了自動換source

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →