summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-07 02:50:52 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-07 02:50:52 +0400
commit0214143031eb11d2935dec29d2c88d7a011e5d9e (patch)
tree33dddbcb6cba199c31799b9140a1aa26744dfc13 /src/Network/BitTorrent.hs
parent35a6426fc2b317850670eb038800f0cd96e59aee (diff)
~ Another Literate Haskell test.
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r--src/Network/BitTorrent.hs22
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{-
123addTorrent :: ClientSession -> TorrentLoc -> IO ()
124addTorrent 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
134removeTorrent :: ClientSession -> TorrentLoc -> IO ()
135removeTorrent ClientSession {..} TorrentLoc {..} = undefined
136
137deleteTorrent :: ClientSession -> TorrentLoc -> IO ()
138deleteTorrent ClientSession {..} TorrentLoc {..} = undefined
139-} \ No newline at end of file