diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-07 02:50:52 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-07 02:50:52 +0400 |
commit | 0214143031eb11d2935dec29d2c88d7a011e5d9e (patch) | |
tree | 33dddbcb6cba199c31799b9140a1aa26744dfc13 /src/Network/BitTorrent.hs | |
parent | 35a6426fc2b317850670eb038800f0cd96e59aee (diff) |
~ Another Literate Haskell test.
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 | ||