summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/Exchange/Bitfield.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Network/BitTorrent/Exchange/Bitfield.hs b/src/Network/BitTorrent/Exchange/Bitfield.hs
index eca11d83..7bae3475 100644
--- a/src/Network/BitTorrent/Exchange/Bitfield.hs
+++ b/src/Network/BitTorrent/Exchange/Bitfield.hs
@@ -7,22 +7,23 @@
7-- 7--
8-- This modules provides all necessary machinery to work with 8-- This modules provides all necessary machinery to work with
9-- bitfields. Bitfields are used to keep track indices of complete 9-- bitfields. Bitfields are used to keep track indices of complete
10-- pieces either peer have or client have. 10-- pieces either this peer have or remote peer have.
11-- 11--
12-- There are also commonly used piece seletion algorithms 12-- There are also commonly used piece seletion algorithms
13-- which used to find out which one next piece to download. 13-- which used to find out which one next piece to download.
14-- Selectors considered to be used in the following order: 14-- Selectors considered to be used in the following order:
15-- 15--
16-- * Random first - at the start. 16-- * 'randomFirst' - at the start of download.
17-- 17--
18-- * Rarest first selection - performed to avoid situation when 18-- * 'rarestFirst' - performed to avoid situation when
19-- rarest piece is unaccessible. 19-- rarest piece is unaccessible.
20-- 20--
21-- * /End game/ seletion - performed after a peer has requested all 21-- * 'endGame' - performed after a peer has requested all
22-- the subpieces of the content. 22-- the subpieces of the content.
23-- 23--
24-- Note that BitTorrent applies the strict priority policy for 24-- Note that BitTorrent protocol recommend (TODO link?) the
25-- /subpiece/ or /blocks/ selection. 25-- 'strictFirst' priority policy for /subpiece/ or /blocks/
26-- selection.
26-- 27--
27{-# LANGUAGE CPP #-} 28{-# LANGUAGE CPP #-}
28{-# LANGUAGE BangPatterns #-} 29{-# LANGUAGE BangPatterns #-}