summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker/Session.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-11-30 11:10:38 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-11-30 11:10:38 +0400
commit7f54308b57615bc61c0727538af2b5a54366eadb (patch)
tree8d47fb66163a8e9d114f1debf5711eca45500055 /src/Network/BitTorrent/Tracker/Session.hs
parentd4ee859973b200d3f81ea56b2e40847ed8c93510 (diff)
Redesign tracker subsustem
Diffstat (limited to 'src/Network/BitTorrent/Tracker/Session.hs')
-rw-r--r--src/Network/BitTorrent/Tracker/Session.hs56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Tracker/Session.hs b/src/Network/BitTorrent/Tracker/Session.hs
new file mode 100644
index 00000000..3cfc4b52
--- /dev/null
+++ b/src/Network/BitTorrent/Tracker/Session.hs
@@ -0,0 +1,56 @@
1module Network.BitTorrent.Tracker.Session
2 (
3 ) where
4
5import Data.Torrent.Progress
6import Data.Torrent.InfoHash
7import Network.BitTorrent.Core.PeerAddr
8import Network.BitTorrent.Tracker.Message
9
10data PeerInfo = PeerInfo
11 { peerId :: PeerId
12 , peerPort :: PortNumber
13 , peerIP :: Maybe HostAddress
14 }
15
16data Session = Session
17 { sesInfoHash :: !InfoHash
18 , sesPeerInfo :: !PeerInfo
19 }
20
21data SAnnounceQuery = SAnnounceQuery
22 { sreqProgress :: Progress
23 , sreqNumWant :: Maybe Int
24 , sreqEvent :: Maybe Event
25 }
26
27type SAnnounceInfo = [PeerAddr]
28
29f :: Session -> SAnnounceQuery -> AnnounceQuery
30f Session {..} SAnnounceQuery {..} = AnnounceQuery
31 { reqInfoHash = sesInfoHash
32 , reqPeerInfo = sesPeerInfo
33 , reqProgress = sreqProgress
34 , reqNumWant = undefined
35 , reqEvent = sreqEvent
36 }
37
38data Settings = Settings
39
40data Manager = Manager
41 {
42 }
43
44
45g :: Session -> AnnounceInfo -> SAnnounceInfo
46g Session {..} SAnnounceInfo {..} = undefined
47
48
49reannounce :: HTracker -> IO ()
50reannounce = undefined
51
52forceReannounce :: HTracker -> IO ()
53forceReannounce = undefined
54
55scrape :: HTracker -> IO ()
56scrape = undefined