summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-26 17:33:32 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-26 17:33:32 +0400
commitb4dedc225b719b58505eed20039680d21c3334e7 (patch)
tree28892d12fb5930b3fb9e3af41a83801f7433fb1b /src/Network/BitTorrent/Tracker
parentfa01c6b1b3918b5dc68933ad18a7ce930788338b (diff)
Document udp tracker options
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r--src/Network/BitTorrent/Tracker/RPC/UDP.hs27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/Network/BitTorrent/Tracker/RPC/UDP.hs b/src/Network/BitTorrent/Tracker/RPC/UDP.hs
index db9c32b3..76188eaf 100644
--- a/src/Network/BitTorrent/Tracker/RPC/UDP.hs
+++ b/src/Network/BitTorrent/Tracker/RPC/UDP.hs
@@ -72,22 +72,39 @@ defMaxTimeout = 15 * 2 ^ (8 :: Int) * sec
72defMultiplier :: Int 72defMultiplier :: Int
73defMultiplier = 2 73defMultiplier = 2
74 74
75-- announce request packet
76defMaxPacketSize :: Int 75defMaxPacketSize :: Int
77defMaxPacketSize = 98 76defMaxPacketSize = 98
78 77
78-- | Manager configuration.
79data Options = Options 79data Options = Options
80 { optMaxPacketSize :: {-# UNPACK #-} !Int 80 { -- | Max size of a /response/ packet.
81 81 --
82 -- | in seconds. 82 -- 'optMaxPacketSize' /must/ be a positive value.
83 --
84 optMaxPacketSize :: {-# UNPACK #-} !Int
85
86 -- | Starting timeout interval. If a response is not received
87 -- after 'optMinTimeout' then 'Manager' repeat RPC with timeout
88 -- interval multiplied by 'optMultiplier' and so on until
89 -- timeout interval reach 'optMaxTimeout'.
90 --
91 -- 'optMinTimeout' /must/ be a positive value.
92 --
83 , optMinTimeout :: {-# UNPACK #-} !Int 93 , optMinTimeout :: {-# UNPACK #-} !Int
84 94
85 -- | in seconds. 95 -- | After 'optMaxTimeout' reached and tracker still not
96 -- responding both 'announce' and 'scrape' functions will throw
97 -- 'TimeoutExpired' exception.
98 --
99 -- 'optMaxTimeout' /must/ be greater than 'optMinTimeout'.
100 --
86 , optMaxTimeout :: {-# UNPACK #-} !Int 101 , optMaxTimeout :: {-# UNPACK #-} !Int
87 102
103 -- | 'optMultiplier' must a positive value.
88 , optMultiplier :: {-# UNPACK #-} !Int 104 , optMultiplier :: {-# UNPACK #-} !Int
89 } deriving (Show, Eq) 105 } deriving (Show, Eq)
90 106
107-- | Options suitable for bittorrent client.
91instance Default Options where 108instance Default Options where
92 def = Options 109 def = Options
93 { optMaxPacketSize = defMaxPacketSize 110 { optMaxPacketSize = defMaxPacketSize