SlideShare a Scribd company logo
1 of 48
Download to read offline
BitTorrent on iOS
Michael Caylus / Simone Civetta
12/01/2017
Michael Simone
Quiz
‘How many of you need to
sync large quantity of files
periodically?’
BitTorrent
Designed: April 2001
First released: July 2001 Bram Cohen
A
Peer-To-Peer Protocol
#1 usage:
Sharing Large Media Files
170M active users* 40% of all Internet traffic**
10 popular clients
uTorrent, Xunlei, Transmission, Vuze, qBittorent,
Deluge, BitComet and Tixatit
* Wikipedia
CompaniesPiracy
** BitTorrent Inc.
Facilitates transfer of large/multiple files
Works on unreliable network connections
Downloads can be resumed any time
✔
✔
✔
In Detail
Basics
Files are
shared among
the users
Files to be shared
are split in
multiple chunks
Peers
contribute
Torrent (metadata)
Pieces / Segment
Swarm
Peers / Leechers
Seeds
Trackers
Stakeholders
Metainfo file (bencoded dictionary)
Torrent File
ANNOUNCE
Announce URL of the tracker
PIECE LENGTH
INFO
Dictionary describing the files’ chunks
PIECES (20-byte SHA1 Hash Values)
LENGTH
NAME
PIECE LENGTH
PIECES (20-byte SHA1 Hash Values)
NAME
FILES
LENGTH
PATH
Always-available seed
Firewall-friendly stream
Easy-to-manage service
Our Challenges
!
!
!
Torrent (metadata)
Pieces / Segment
Swarm
Peers / Leechers
Seeds
Trackers
WebSeed
2
WebSeed
Similar to HTTP direct download
Guarantees availability of resources
Independent of swarm sanity
Extension on bitTorrent protocol
Introduced in 2006
Quiz
‘How many of you have
already developed a
BitTorrent client?’
libtorrent
BitTorrent OSS Implementation
Developed by Arvid Norberg, since 2003
Written in C++, Cross Platform
Memory/CPU efficient, feature-packed
✔
✔
✔
✔
libtorrent
Pros
Easily configurable
Supports trackerless mode, with
DHT
Supports Web Seeds (i.e. a seed can
be a HTTP host), and SSL Torrents
Supports Local Service Discovery
Pros and Cons
Cons
No CocoaPods/Carthage distribution
Depends on other libraries
Not based on URLConnection
Does not support iOS background
sessions
Alternatives
MultiPeer
Connectivity
Couchbase Realm
Alternatives
Alternatives: Pros
MultiPeer
Connectivity
Couchbase
It’s a real DB
Sync based on
NSURLSession
Supports MPC
Realm
It’s a real DB
Sync based on
NSURLSession
Native
Supports
Bluetooth
Alternatives: Cons
MultiPeer
Connectivity
Couchbase
Depends on a
proprietary stack
Doesn’t work
with chunks
Realm
Depends on a
proprietary stack
No real P2P
8 devices per
session
Manual handling
of chunks
How to Build
OpenSSL
Boost C++ TLS/SSL and crypto C library
Requirements
How to Build
https://github.com/xebia-france/libtorrent-ios-resources
Option A: Pre-configured Xcode Project
- https://github.com/chublix/libtorrent-ios
- Adapt for OpenSSL
Option B: Qt Creator
- Build OpenSSL and Boost separately
- Build libtorrent, for all the platforms (e.g. iphoneos and iphonesimulator)
- lipo (i.e., merge the slices) of the different platforms
Option C: Bash Script
- cf. xebia-france/libtorrent-ios-resources/build-script
Sources
Popcorn Time iOS
https://github.com/danylokostyshyn/popcorntime-ios
Popcorn Time TV:
https://github.com/PopcornTimeTV/PopcornTimeTV
Popcorn Torrent:
https://github.com/PopcornTimeTV/PopcornTorrent (GCD WebServer / Torrent client for iOS)
Configuration
Configuration
session_settings settings = ses.settings();
settings.ssl_listen = 4443;
settings.active_loaded_limit = 1;
settings.max_peerlist_size = 10;
settings.min_announce_interval = 30;
settings.urlseed_wait_retry = 10;
ses.set_settings(settings);
// http://libtorrent.org/reference-Settings.html
settings.local_service_announce_interval = 30;
settings.active_lsd_limit = 1;
// ...
ses.start_lsd();
// ...
ses.stop_lsd();
Configuration (Local Service Discovery)
How Incremental
Download Works
How Incremental Download Works
No modification in the content: No Download
Modification in the content referenced changed: Download Starts
The SHA1 of each chunk is compared to the version on disk:
Implementation
C++ / Swift Bridging
03
04
01
02 Add wrapper class’s header file into bridging header
Implement a wrapper class in .mm file (Obj C++ )
Use wrapper class in Swift03
C++ / Swift Bridging
02 Implement a wrapper class
Wrapper Class (Header)
#import <Foundation/Foundation.h>
@interface LibTorrentWrapper : NSObject {
- (void)initSession:(NSInteger)fromPort toPort:(NSInteger)toPort;
- (void)addNewTorrentFromFile:(NSString *)filePath;
}
C++ / Swift Bridging
02 Implement a wrapper class
Wrapper Class (Implementation)
@interface LibtorrentWrapper()
@property libtorrent::session *session;
@end
@implementation LibtorrentWrapper
- (void)initSession:(NSInteger)fromPort toPort:(NSInteger)toPort {
self.session = new libtorrent::session();
session_settings settings = self.session->settings();
// Apply Settings here...
self.session->set_settings(settings);
libtorrent::error_code ec;
self.session->listen_on(std::make_pair(fromPort, toPort), ec)
}
C++ / Swift Bridging
02 Implement a wrapper class
Wrapper Class (Implementation)
//...
- (void)addNewTorrentWithData:(NSData *)data {
libtorrent::add_torrent_params params;
params.save_path = // Some dir...
libtorrent::error_code ec;
params.ti = new libtorrent::torrent_info((const char*)data.bytes, data.length, ec);
self.session->add_torrent(params, ec);
}
@end
C++ / Swift Bridging
02 Implement a wrapper class
Invoke Wrapper Class in Swift
func startTorrentSession() {
var torrentWrapper = LibtorrentWrapper()
torrentWrapper.initSession(6881, toPort: 6889)
torrentWrapper.addNewTorrentWithData(/* Some Data */)
}
Event loop
03
04
01
02 Pop alert events each time callback is invoked
Set-up a timer that triggers a callback periodically
Feed torrent progress info03
Fetch alerts
- (void)fetchAlerts {
std::deque<alert *> deque;
_session->pop_alerts(&deque);
for (std::deque<alert *>::iterator it=deque.begin(); it != deque.end(); ++it) {
std::unique_ptr<alert> alert(*it);
switch (alert->type()) {
case metadata_received_alert::alert_type:
//**
case piece_finished_alert::alert_type:
//** You can feed progress info here
case torrent_finished_alert::alert_type:
//**
default: break;
}
}
deque.clear();
}
Fetch torrent progress info
- (dl_info)getCurrentTorrentInfo:(piece_finished_alert *)alert {
dl_info result;
torrent_handle t = alert->handle;
try {
t->get_torrent_info();
} catch (libtorrent_exception &e) {
return result;
}
torrent_status ts = t->status(torrent_handle::query_pieces);
result.seeders = ts.num_seeds;
result.peers = ts.num_peers;
result.downloadRateBs = ts.download_rate;
result.uploadRateBs = ts.upload_rate;
torrent_info ti = t->get_torrent_info();
result.downloaded = ts.total_done;
result.progress = ts.progress_ppm;
result.completed_time = ts.completed_time;
return result
}
Caveats
Caveats
1 Needs fine tuning, i.e. for avoiding heavy
battery consumption
No background sessions
Almost no iOS help resource available
System proxy support to be manually
implemented (via
CFNetworkCopySystemProxySettings)
2
3
4
BitTorrent on iOS
BitTorrent on iOS

More Related Content

What's hot

PHP development with Docker
PHP development with DockerPHP development with Docker
PHP development with DockerYosh de Vos
 
CocoaHeads Rennes #13 : CocoaPods
CocoaHeads Rennes #13 : CocoaPodsCocoaHeads Rennes #13 : CocoaPods
CocoaHeads Rennes #13 : CocoaPodsCocoaHeadsRNS
 
Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...
Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...
Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...Fwdays
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014André Rømcke
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleRobert Reiz
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)Ruoshi Ling
 
Docker deploy
Docker deployDocker deploy
Docker deployEric Ahn
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsThomas Chacko
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeDanielle Madeley
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudIdeato
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreChef Software, Inc.
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleDmytro Slupytskyi
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Install openstack
Install openstackInstall openstack
Install openstack어형 이
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by DockerTerry Chen
 

What's hot (20)

PHP development with Docker
PHP development with DockerPHP development with Docker
PHP development with Docker
 
CocoaHeads Rennes #13 : CocoaPods
CocoaHeads Rennes #13 : CocoaPodsCocoaHeads Rennes #13 : CocoaPods
CocoaHeads Rennes #13 : CocoaPods
 
Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...
Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...
Алексей Петров "Dockerize Me: Distributed PHP applications with Symfony, Dock...
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & Ansible
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
 
Docker deploy
Docker deployDocker deploy
Docker deploy
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
CoreOS Overview
CoreOS OverviewCoreOS Overview
CoreOS Overview
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and Ansible
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Install openstack
Install openstackInstall openstack
Install openstack
 
Node.js essentials
 Node.js essentials Node.js essentials
Node.js essentials
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 

Viewers also liked

Comment faire de HLS votre solution vidéo préférée ?
Comment faire de HLS votre solution vidéo préférée ?Comment faire de HLS votre solution vidéo préférée ?
Comment faire de HLS votre solution vidéo préférée ?CocoaHeads France
 
Un retour d'expérience sur Apple Pay
Un retour d'expérience sur Apple PayUn retour d'expérience sur Apple Pay
Un retour d'expérience sur Apple PayCocoaHeads France
 
Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.CocoaHeads France
 
Tout savoir pour devenir Freelance
Tout savoir pour devenir FreelanceTout savoir pour devenir Freelance
Tout savoir pour devenir FreelanceFlorent Douine
 
Firebase par nicolas lehovetzki
Firebase par nicolas lehovetzkiFirebase par nicolas lehovetzki
Firebase par nicolas lehovetzkiCocoaHeads France
 
Introduction to WebRTC on iOS
Introduction to WebRTC on iOSIntroduction to WebRTC on iOS
Introduction to WebRTC on iOSCocoaHeads France
 
Safari app extensions cleared up by Sanaa Squalli
Safari app extensions cleared up by Sanaa SqualliSafari app extensions cleared up by Sanaa Squalli
Safari app extensions cleared up by Sanaa SqualliCocoaHeads France
 
Advanced functional programing in Swift
Advanced functional programing in SwiftAdvanced functional programing in Swift
Advanced functional programing in SwiftVincent Pradeilles
 
L'intégration continue avec Bitrise
L'intégration continue avec BitriseL'intégration continue avec Bitrise
L'intégration continue avec BitriseCocoaHeads France
 
La sécurité sur iOS par Arnaud de Bock
La sécurité sur iOS par Arnaud de BockLa sécurité sur iOS par Arnaud de Bock
La sécurité sur iOS par Arnaud de BockNicolas Lourenço
 
MVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire LhotelierMVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire LhotelierCocoaHeads France
 

Viewers also liked (20)

Comment faire de HLS votre solution vidéo préférée ?
Comment faire de HLS votre solution vidéo préférée ?Comment faire de HLS votre solution vidéo préférée ?
Comment faire de HLS votre solution vidéo préférée ?
 
Un retour d'expérience sur Apple Pay
Un retour d'expérience sur Apple PayUn retour d'expérience sur Apple Pay
Un retour d'expérience sur Apple Pay
 
Monads in Swift
Monads in SwiftMonads in Swift
Monads in Swift
 
Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.
 
Tout savoir pour devenir Freelance
Tout savoir pour devenir FreelanceTout savoir pour devenir Freelance
Tout savoir pour devenir Freelance
 
Super combinators
Super combinatorsSuper combinators
Super combinators
 
Firebase par nicolas lehovetzki
Firebase par nicolas lehovetzkiFirebase par nicolas lehovetzki
Firebase par nicolas lehovetzki
 
Introduction to WebRTC on iOS
Introduction to WebRTC on iOSIntroduction to WebRTC on iOS
Introduction to WebRTC on iOS
 
Safari app extensions cleared up by Sanaa Squalli
Safari app extensions cleared up by Sanaa SqualliSafari app extensions cleared up by Sanaa Squalli
Safari app extensions cleared up by Sanaa Squalli
 
Make Acccessibility Great Again
Make Acccessibility Great AgainMake Acccessibility Great Again
Make Acccessibility Great Again
 
Présentation de HomeKit
Présentation de HomeKitPrésentation de HomeKit
Présentation de HomeKit
 
IoT Best practices
 IoT Best practices IoT Best practices
IoT Best practices
 
Advanced functional programing in Swift
Advanced functional programing in SwiftAdvanced functional programing in Swift
Advanced functional programing in Swift
 
L'intégration continue avec Bitrise
L'intégration continue avec BitriseL'intégration continue avec Bitrise
L'intégration continue avec Bitrise
 
La sécurité sur iOS par Arnaud de Bock
La sécurité sur iOS par Arnaud de BockLa sécurité sur iOS par Arnaud de Bock
La sécurité sur iOS par Arnaud de Bock
 
MVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire LhotelierMVC-RS par Grégoire Lhotelier
MVC-RS par Grégoire Lhotelier
 
Project Entourage
Project EntourageProject Entourage
Project Entourage
 
CloudKit as a backend
CloudKit as a backendCloudKit as a backend
CloudKit as a backend
 
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
 
Handle the error
Handle the errorHandle the error
Handle the error
 

Similar to BitTorrent on iOS

End-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTEnd-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTBenjamin Cabé
 
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...Akihiro Suda
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Patrick Chanezon
 
Ethereum introduction
Ethereum introductionEthereum introduction
Ethereum introductionkesavan N B
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Samsung Open Source Group
 
mininet-intro.pdf
mininet-intro.pdfmininet-intro.pdf
mininet-intro.pdfMarioDM3
 
Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)kholis_mjd
 
Criminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and FutureCriminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and FutureJim Lippard
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesRobert Lemke
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Githubhubx
 
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...Gonéri Le Bouder
 
DevOPS training - Day 1/2
DevOPS training - Day 1/2DevOPS training - Day 1/2
DevOPS training - Day 1/2Vincent Mercier
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 

Similar to BitTorrent on iOS (20)

Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
End-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTEnd-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoT
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Zenoh: The Genesis
Zenoh: The GenesisZenoh: The Genesis
Zenoh: The Genesis
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017
 
Ethereum introduction
Ethereum introductionEthereum introduction
Ethereum introduction
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
Connected Tizen: Bringing Tizen to Your Connected Devices Using the Yocto Pro...
 
mininet-intro.pdf
mininet-intro.pdfmininet-intro.pdf
mininet-intro.pdf
 
Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)
 
Criminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and FutureCriminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and Future
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
Beyond static configuration
Beyond static configurationBeyond static configuration
Beyond static configuration
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Github
 
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
 
DevOPS training - Day 1/2
DevOPS training - Day 1/2DevOPS training - Day 1/2
DevOPS training - Day 1/2
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 

More from CocoaHeads France

Mutation testing for a safer Future
Mutation testing for a safer FutureMutation testing for a safer Future
Mutation testing for a safer FutureCocoaHeads France
 
Visual accessibility in iOS11
Visual accessibility in iOS11Visual accessibility in iOS11
Visual accessibility in iOS11CocoaHeads France
 
My script - One year of CocoaHeads
My script - One year of CocoaHeadsMy script - One year of CocoaHeads
My script - One year of CocoaHeadsCocoaHeads France
 
Ui testing dealing with push notifications
Ui testing dealing with push notificationsUi testing dealing with push notifications
Ui testing dealing with push notificationsCocoaHeads France
 
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECocoaHeads France
 
Programme MFI retour d'expérience
Programme MFI retour d'expérienceProgramme MFI retour d'expérience
Programme MFI retour d'expérienceCocoaHeads France
 
How to communicate with Smart things?
How to communicate with Smart things?How to communicate with Smart things?
How to communicate with Smart things?CocoaHeads France
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPodsCocoaHeads France
 
J'ai fait une app native en React Native
J'ai fait une app native en React NativeJ'ai fait une app native en React Native
J'ai fait une app native en React NativeCocoaHeads France
 

More from CocoaHeads France (14)

Mutation testing for a safer Future
Mutation testing for a safer FutureMutation testing for a safer Future
Mutation testing for a safer Future
 
iOS App Group for Debugging
iOS App Group for DebuggingiOS App Group for Debugging
iOS App Group for Debugging
 
Asynchronous swift
Asynchronous swiftAsynchronous swift
Asynchronous swift
 
Visual accessibility in iOS11
Visual accessibility in iOS11Visual accessibility in iOS11
Visual accessibility in iOS11
 
My script - One year of CocoaHeads
My script - One year of CocoaHeadsMy script - One year of CocoaHeads
My script - One year of CocoaHeads
 
Ui testing dealing with push notifications
Ui testing dealing with push notificationsUi testing dealing with push notifications
Ui testing dealing with push notifications
 
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
 
Design like a developer
Design like a developerDesign like a developer
Design like a developer
 
Programme MFI retour d'expérience
Programme MFI retour d'expérienceProgramme MFI retour d'expérience
Programme MFI retour d'expérience
 
How to communicate with Smart things?
How to communicate with Smart things?How to communicate with Smart things?
How to communicate with Smart things?
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
 
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
 
J'ai fait une app native en React Native
J'ai fait une app native en React NativeJ'ai fait une app native en React Native
J'ai fait une app native en React Native
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 

BitTorrent on iOS

  • 1. BitTorrent on iOS Michael Caylus / Simone Civetta 12/01/2017
  • 4. ‘How many of you need to sync large quantity of files periodically?’
  • 6.
  • 7.
  • 8. Designed: April 2001 First released: July 2001 Bram Cohen A Peer-To-Peer Protocol #1 usage: Sharing Large Media Files
  • 9. 170M active users* 40% of all Internet traffic** 10 popular clients uTorrent, Xunlei, Transmission, Vuze, qBittorent, Deluge, BitComet and Tixatit * Wikipedia CompaniesPiracy ** BitTorrent Inc.
  • 10. Facilitates transfer of large/multiple files Works on unreliable network connections Downloads can be resumed any time ✔ ✔ ✔
  • 12. Basics Files are shared among the users Files to be shared are split in multiple chunks Peers contribute
  • 13. Torrent (metadata) Pieces / Segment Swarm Peers / Leechers Seeds Trackers Stakeholders
  • 14. Metainfo file (bencoded dictionary) Torrent File ANNOUNCE Announce URL of the tracker PIECE LENGTH INFO Dictionary describing the files’ chunks PIECES (20-byte SHA1 Hash Values) LENGTH NAME PIECE LENGTH PIECES (20-byte SHA1 Hash Values) NAME FILES LENGTH PATH
  • 16. Torrent (metadata) Pieces / Segment Swarm Peers / Leechers Seeds Trackers WebSeed
  • 17. 2 WebSeed Similar to HTTP direct download Guarantees availability of resources Independent of swarm sanity Extension on bitTorrent protocol Introduced in 2006
  • 18. Quiz
  • 19. ‘How many of you have already developed a BitTorrent client?’
  • 21. BitTorrent OSS Implementation Developed by Arvid Norberg, since 2003 Written in C++, Cross Platform Memory/CPU efficient, feature-packed ✔ ✔ ✔ ✔ libtorrent
  • 22. Pros Easily configurable Supports trackerless mode, with DHT Supports Web Seeds (i.e. a seed can be a HTTP host), and SSL Torrents Supports Local Service Discovery Pros and Cons Cons No CocoaPods/Carthage distribution Depends on other libraries Not based on URLConnection Does not support iOS background sessions
  • 25. Alternatives: Pros MultiPeer Connectivity Couchbase It’s a real DB Sync based on NSURLSession Supports MPC Realm It’s a real DB Sync based on NSURLSession Native Supports Bluetooth
  • 26. Alternatives: Cons MultiPeer Connectivity Couchbase Depends on a proprietary stack Doesn’t work with chunks Realm Depends on a proprietary stack No real P2P 8 devices per session Manual handling of chunks
  • 28. OpenSSL Boost C++ TLS/SSL and crypto C library Requirements
  • 29. How to Build https://github.com/xebia-france/libtorrent-ios-resources Option A: Pre-configured Xcode Project - https://github.com/chublix/libtorrent-ios - Adapt for OpenSSL Option B: Qt Creator - Build OpenSSL and Boost separately - Build libtorrent, for all the platforms (e.g. iphoneos and iphonesimulator) - lipo (i.e., merge the slices) of the different platforms Option C: Bash Script - cf. xebia-france/libtorrent-ios-resources/build-script
  • 30. Sources Popcorn Time iOS https://github.com/danylokostyshyn/popcorntime-ios Popcorn Time TV: https://github.com/PopcornTimeTV/PopcornTimeTV Popcorn Torrent: https://github.com/PopcornTimeTV/PopcornTorrent (GCD WebServer / Torrent client for iOS)
  • 32. Configuration session_settings settings = ses.settings(); settings.ssl_listen = 4443; settings.active_loaded_limit = 1; settings.max_peerlist_size = 10; settings.min_announce_interval = 30; settings.urlseed_wait_retry = 10; ses.set_settings(settings); // http://libtorrent.org/reference-Settings.html
  • 33. settings.local_service_announce_interval = 30; settings.active_lsd_limit = 1; // ... ses.start_lsd(); // ... ses.stop_lsd(); Configuration (Local Service Discovery)
  • 35. How Incremental Download Works No modification in the content: No Download Modification in the content referenced changed: Download Starts The SHA1 of each chunk is compared to the version on disk:
  • 37. C++ / Swift Bridging 03 04 01 02 Add wrapper class’s header file into bridging header Implement a wrapper class in .mm file (Obj C++ ) Use wrapper class in Swift03
  • 38. C++ / Swift Bridging 02 Implement a wrapper class Wrapper Class (Header) #import <Foundation/Foundation.h> @interface LibTorrentWrapper : NSObject { - (void)initSession:(NSInteger)fromPort toPort:(NSInteger)toPort; - (void)addNewTorrentFromFile:(NSString *)filePath; }
  • 39. C++ / Swift Bridging 02 Implement a wrapper class Wrapper Class (Implementation) @interface LibtorrentWrapper() @property libtorrent::session *session; @end @implementation LibtorrentWrapper - (void)initSession:(NSInteger)fromPort toPort:(NSInteger)toPort { self.session = new libtorrent::session(); session_settings settings = self.session->settings(); // Apply Settings here... self.session->set_settings(settings); libtorrent::error_code ec; self.session->listen_on(std::make_pair(fromPort, toPort), ec) }
  • 40. C++ / Swift Bridging 02 Implement a wrapper class Wrapper Class (Implementation) //... - (void)addNewTorrentWithData:(NSData *)data { libtorrent::add_torrent_params params; params.save_path = // Some dir... libtorrent::error_code ec; params.ti = new libtorrent::torrent_info((const char*)data.bytes, data.length, ec); self.session->add_torrent(params, ec); } @end
  • 41. C++ / Swift Bridging 02 Implement a wrapper class Invoke Wrapper Class in Swift func startTorrentSession() { var torrentWrapper = LibtorrentWrapper() torrentWrapper.initSession(6881, toPort: 6889) torrentWrapper.addNewTorrentWithData(/* Some Data */) }
  • 42. Event loop 03 04 01 02 Pop alert events each time callback is invoked Set-up a timer that triggers a callback periodically Feed torrent progress info03
  • 43. Fetch alerts - (void)fetchAlerts { std::deque<alert *> deque; _session->pop_alerts(&deque); for (std::deque<alert *>::iterator it=deque.begin(); it != deque.end(); ++it) { std::unique_ptr<alert> alert(*it); switch (alert->type()) { case metadata_received_alert::alert_type: //** case piece_finished_alert::alert_type: //** You can feed progress info here case torrent_finished_alert::alert_type: //** default: break; } } deque.clear(); }
  • 44. Fetch torrent progress info - (dl_info)getCurrentTorrentInfo:(piece_finished_alert *)alert { dl_info result; torrent_handle t = alert->handle; try { t->get_torrent_info(); } catch (libtorrent_exception &e) { return result; } torrent_status ts = t->status(torrent_handle::query_pieces); result.seeders = ts.num_seeds; result.peers = ts.num_peers; result.downloadRateBs = ts.download_rate; result.uploadRateBs = ts.upload_rate; torrent_info ti = t->get_torrent_info(); result.downloaded = ts.total_done; result.progress = ts.progress_ppm; result.completed_time = ts.completed_time; return result }
  • 46. Caveats 1 Needs fine tuning, i.e. for avoiding heavy battery consumption No background sessions Almost no iOS help resource available System proxy support to be manually implemented (via CFNetworkCopySystemProxySettings) 2 3 4