From 74aa8dffa1d754a296c56c21f2084ce90e17f81d Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sat, 15 Mar 2014 21:31:33 +0400 Subject: Add stubs for TEX --- src/Network/BitTorrent/Tracker/Session.hs | 40 +++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'src/Network/BitTorrent/Tracker') 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 , newSession , closeSession - -- * Events - , Event (..) + -- * Trackers , notify - - -- * Query , askPeers + + -- * Tracker Exchange + -- | BEP28: + , addTracker + , removeTracker + , getTrackers + , getTrustedTrackers ) where import Control.Applicative @@ -194,6 +198,32 @@ data TrackerInfo = TrackerInfo --instance ToJSON TrackerInfo where -- toJSON = undefined --- | --getSessionState :: Session -> IO (TrackerList TrackerInfo) --getSessionState = undefined + +{----------------------------------------------------------------------- +-- Tracker exchange +-----------------------------------------------------------------------} + +-- Trackers discovered through this protocol SHOULD be treated with a +-- certain amount of suspicion. Since the source of a tracker exchange +-- message cannot be trusted, an implementation SHOULD have a lower +-- number of retries before giving up entirely. + +addTracker :: Session -> URI -> IO () +addTracker = undefined + +removeTracker :: Session -> URI -> IO () +removeTracker = undefined + +-- Also, as specified under the definitions section, a tracker that +-- has not worked should never be propagated to other peers over the +-- tracker exchange protocol. + +-- | Return all known trackers. +getTrackers :: Session -> IO [URI] +getTrackers = undefined + +-- | Return trackers from torrent file and +getTrustedTrackers :: Session -> IO [URI] +getTrustedTrackers = undefined -- cgit v1.2.3