summaryrefslogtreecommitdiff
path: root/examples/Main.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-14 01:53:13 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-14 01:53:13 +0400
commite160fcee699c7012d8f50a6e4bcd3b8a9c02aedf (patch)
tree0682225359734bec5414c16862880bd8b76f310c /examples/Main.hs
parentf4e4a77a3150b402e93a139a0db54e4dad02d03d (diff)
~ Hide PeerSession and SwarmSession.
Diffstat (limited to 'examples/Main.hs')
-rw-r--r--examples/Main.hs13
1 files changed, 0 insertions, 13 deletions
diff --git a/examples/Main.hs b/examples/Main.hs
index bc3fbb8b..1d3b711b 100644
--- a/examples/Main.hs
+++ b/examples/Main.hs
@@ -1,23 +1,10 @@
1module Main (main) where 1module Main (main) where
2 2
3import Control.Monad
4import Network.BitTorrent 3import Network.BitTorrent
5import Network.BitTorrent.Extension
6import System.Environment 4import System.Environment
7import Control.Monad.Trans
8 5
9main :: IO () 6main :: IO ()
10main = do 7main = do
11 [path] <- getArgs 8 [path] <- getArgs
12 torrent <- fromFile path 9 torrent <- fromFile path
13 print (contentLayout "./" (tInfo torrent)) 10 print (contentLayout "./" (tInfo torrent))
14 client <- newClient 100 [ExtDHT]
15 swarm <- newLeecher client torrent
16 storage <- swarm `bindTo` "/tmp/"
17 ppStorage storage >>= print
18 discover swarm $ do
19 liftIO $ print "connected to peer"
20 forever $ do
21 liftIO (getCurrentProgress client >>= print)
22 exchange storage
23 liftIO $ print "disconnected"