summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Client/Swarm.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-04 07:02:47 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-04 07:02:47 +0400
commiteaf426da786acf925a1786938c5ae2b1c9230a07 (patch)
treea5a388f783204ecfe170b99de7ad5edc64b95e4c /src/Network/BitTorrent/Client/Swarm.hs
parentfe07542caf980e24d2e2fc4ec829ea2286f17367 (diff)
Remove orphan module
Diffstat (limited to 'src/Network/BitTorrent/Client/Swarm.hs')
-rw-r--r--src/Network/BitTorrent/Client/Swarm.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Network/BitTorrent/Client/Swarm.hs b/src/Network/BitTorrent/Client/Swarm.hs
index 7fdd1f2f..bd48f8a4 100644
--- a/src/Network/BitTorrent/Client/Swarm.hs
+++ b/src/Network/BitTorrent/Client/Swarm.hs
@@ -5,6 +5,7 @@ module Network.BitTorrent.Client.Swarm
5 ) where 5 ) where
6 6
7import Data.Default 7import Data.Default
8import Data.Maybe
8import Network 9import Network
9 10
10import Data.Torrent 11import Data.Torrent
@@ -18,18 +19,14 @@ data Swarm = Swarm
18 { swarmTopic :: InfoHash 19 { swarmTopic :: InfoHash
19 , thisPeerId :: PeerId 20 , thisPeerId :: PeerId
20 , listenerPort :: PortNumber 21 , listenerPort :: PortNumber
21 , trackerConn :: Tracker
22-- , infoDict ::
23 } 22 }
24 23
25newLeecher :: PeerId -> PortNumber -> Torrent -> IO Swarm 24newLeecher :: PeerId -> PortNumber -> Torrent -> IO Swarm
26newLeecher pid port Torrent {..} = do 25newLeecher pid port Torrent {..} = do
27 tracker <- connect undefined
28 return Swarm 26 return Swarm
29 { swarmTopic = idInfoHash tInfoDict 27 { swarmTopic = idInfoHash tInfoDict
30 , thisPeerId = pid 28 , thisPeerId = pid
31 , listenerPort = port 29 , listenerPort = port
32 , trackerConn = tracker
33 } 30 }
34 31
35getAnnounceQuery :: Swarm -> AnnounceQuery 32getAnnounceQuery :: Swarm -> AnnounceQuery
@@ -45,5 +42,11 @@ getAnnounceQuery Swarm {..} = AnnounceQuery
45 42
46askPeers :: Swarm -> IO [PeerAddr IP] 43askPeers :: Swarm -> IO [PeerAddr IP]
47askPeers s @ Swarm {..} = do 44askPeers s @ Swarm {..} = do
48 AnnounceInfo {..} <- RPC.announce (getAnnounceQuery s) trackerConn 45-- AnnounceInfo {..} <- RPC.announce (getAnnounceQuery s) trackerConn
49 return (getPeerList respPeers) 46 return [] -- (getPeerList respPeers)
47
48--reannounce :: HTracker -> IO ()
49--reannounce = undefined
50
51--forceReannounce :: HTracker -> IO ()
52--forceReannounce = undefined