diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-30 11:10:38 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-30 11:10:38 +0400 |
commit | 7f54308b57615bc61c0727538af2b5a54366eadb (patch) | |
tree | 8d47fb66163a8e9d114f1debf5711eca45500055 /src/Network/BitTorrent/Tracker/Session.hs | |
parent | d4ee859973b200d3f81ea56b2e40847ed8c93510 (diff) |
Redesign tracker subsustem
Diffstat (limited to 'src/Network/BitTorrent/Tracker/Session.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker/Session.hs | 56 |
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 @@ | |||
1 | module Network.BitTorrent.Tracker.Session | ||
2 | ( | ||
3 | ) where | ||
4 | |||
5 | import Data.Torrent.Progress | ||
6 | import Data.Torrent.InfoHash | ||
7 | import Network.BitTorrent.Core.PeerAddr | ||
8 | import Network.BitTorrent.Tracker.Message | ||
9 | |||
10 | data PeerInfo = PeerInfo | ||
11 | { peerId :: PeerId | ||
12 | , peerPort :: PortNumber | ||
13 | , peerIP :: Maybe HostAddress | ||
14 | } | ||
15 | |||
16 | data Session = Session | ||
17 | { sesInfoHash :: !InfoHash | ||
18 | , sesPeerInfo :: !PeerInfo | ||
19 | } | ||
20 | |||
21 | data SAnnounceQuery = SAnnounceQuery | ||
22 | { sreqProgress :: Progress | ||
23 | , sreqNumWant :: Maybe Int | ||
24 | , sreqEvent :: Maybe Event | ||
25 | } | ||
26 | |||
27 | type SAnnounceInfo = [PeerAddr] | ||
28 | |||
29 | f :: Session -> SAnnounceQuery -> AnnounceQuery | ||
30 | f Session {..} SAnnounceQuery {..} = AnnounceQuery | ||
31 | { reqInfoHash = sesInfoHash | ||
32 | , reqPeerInfo = sesPeerInfo | ||
33 | , reqProgress = sreqProgress | ||
34 | , reqNumWant = undefined | ||
35 | , reqEvent = sreqEvent | ||
36 | } | ||
37 | |||
38 | data Settings = Settings | ||
39 | |||
40 | data Manager = Manager | ||
41 | { | ||
42 | } | ||
43 | |||
44 | |||
45 | g :: Session -> AnnounceInfo -> SAnnounceInfo | ||
46 | g Session {..} SAnnounceInfo {..} = undefined | ||
47 | |||
48 | |||
49 | reannounce :: HTracker -> IO () | ||
50 | reannounce = undefined | ||
51 | |||
52 | forceReannounce :: HTracker -> IO () | ||
53 | forceReannounce = undefined | ||
54 | |||
55 | scrape :: HTracker -> IO () | ||
56 | scrape = undefined | ||