diff options
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r-- | src/Network/BitTorrent.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs index c72498d0..ea6b88bd 100644 --- a/src/Network/BitTorrent.hs +++ b/src/Network/BitTorrent.hs | |||
@@ -115,3 +115,25 @@ discover swarm @ SwarmSession {..} action = {-# SCC discover #-} do | |||
115 | addr <- getPeerAddr tses | 115 | addr <- getPeerAddr tses |
116 | spawnP2P swarm addr $ do | 116 | spawnP2P swarm addr $ do |
117 | action | 117 | action |
118 | |||
119 | {----------------------------------------------------------------------- | ||
120 | Torrent management | ||
121 | -----------------------------------------------------------------------} | ||
122 | {- | ||
123 | addTorrent :: ClientSession -> TorrentLoc -> IO () | ||
124 | addTorrent ClientSession {..} TorrentLoc {..} = do | ||
125 | torrent <- fromFile metafilePath | ||
126 | swarm <- newLeecher clientSession torrent | ||
127 | storage <- swarm `bindTo` dataDir | ||
128 | discover swarm $ do | ||
129 | liftIO $ putStrLn "connected to peer" | ||
130 | forever $ do | ||
131 | liftIO $ putStrLn "from mesage loop" | ||
132 | exchange storage | ||
133 | |||
134 | removeTorrent :: ClientSession -> TorrentLoc -> IO () | ||
135 | removeTorrent ClientSession {..} TorrentLoc {..} = undefined | ||
136 | |||
137 | deleteTorrent :: ClientSession -> TorrentLoc -> IO () | ||
138 | deleteTorrent ClientSession {..} TorrentLoc {..} = undefined | ||
139 | -} \ No newline at end of file | ||