summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent.hs22
-rw-r--r--src/Network/BitTorrent/Internal.hs4
2 files changed, 26 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
diff --git a/src/Network/BitTorrent/Internal.hs b/src/Network/BitTorrent/Internal.hs
index 964dfd75..dd5f3bb7 100644
--- a/src/Network/BitTorrent/Internal.hs
+++ b/src/Network/BitTorrent/Internal.hs
@@ -55,6 +55,10 @@ module Network.BitTorrent.Internal
55 , ThreadCount 55 , ThreadCount
56 , defaultThreadCount 56 , defaultThreadCount
57 57
58 , TorrentLoc(..)
59 , registerTorrent
60 , unregisterTorrent
61
58 , newClient 62 , newClient
59 63
60 , getCurrentProgress 64 , getCurrentProgress