summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-03-15 21:31:33 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-03-15 21:31:33 +0400
commit74aa8dffa1d754a296c56c21f2084ce90e17f81d (patch)
tree05e74177c532d631587ceacb2466c8f575f1d536 /src/Network/BitTorrent/Tracker
parent8e5a5dd9b950091f65ff5a4e12e62777bd0ea3f2 (diff)
Add stubs for TEX
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r--src/Network/BitTorrent/Tracker/Session.hs40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/Network/BitTorrent/Tracker/Session.hs b/src/Network/BitTorrent/Tracker/Session.hs
index 295f9322..9b7654dd 100644
--- a/src/Network/BitTorrent/Tracker/Session.hs
+++ b/src/Network/BitTorrent/Tracker/Session.hs
@@ -13,12 +13,16 @@ module Network.BitTorrent.Tracker.Session
13 , newSession 13 , newSession
14 , closeSession 14 , closeSession
15 15
16 -- * Events 16 -- * Trackers
17 , Event (..)
18 , notify 17 , notify
19
20 -- * Query
21 , askPeers 18 , askPeers
19
20 -- * Tracker Exchange
21 -- | BEP28: <http://www.bittorrent.org/beps/bep_0028.html>
22 , addTracker
23 , removeTracker
24 , getTrackers
25 , getTrustedTrackers
22 ) where 26 ) where
23 27
24import Control.Applicative 28import Control.Applicative
@@ -194,6 +198,32 @@ data TrackerInfo = TrackerInfo
194--instance ToJSON TrackerInfo where 198--instance ToJSON TrackerInfo where
195-- toJSON = undefined 199-- toJSON = undefined
196 200
197-- |
198--getSessionState :: Session -> IO (TrackerList TrackerInfo) 201--getSessionState :: Session -> IO (TrackerList TrackerInfo)
199--getSessionState = undefined 202--getSessionState = undefined
203
204{-----------------------------------------------------------------------
205-- Tracker exchange
206-----------------------------------------------------------------------}
207
208-- Trackers discovered through this protocol SHOULD be treated with a
209-- certain amount of suspicion. Since the source of a tracker exchange
210-- message cannot be trusted, an implementation SHOULD have a lower
211-- number of retries before giving up entirely.
212
213addTracker :: Session -> URI -> IO ()
214addTracker = undefined
215
216removeTracker :: Session -> URI -> IO ()
217removeTracker = undefined
218
219-- Also, as specified under the definitions section, a tracker that
220-- has not worked should never be propagated to other peers over the
221-- tracker exchange protocol.
222
223-- | Return all known trackers.
224getTrackers :: Session -> IO [URI]
225getTrackers = undefined
226
227-- | Return trackers from torrent file and
228getTrustedTrackers :: Session -> IO [URI]
229getTrustedTrackers = undefined