diff options
Diffstat (limited to 'examples/Main.hs')
-rw-r--r-- | examples/Main.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/Main.hs b/examples/Main.hs index b8e3c11f..5128b290 100644 --- a/examples/Main.hs +++ b/examples/Main.hs | |||
@@ -1,6 +1,8 @@ | |||
1 | module Main (main) where | 1 | module Main (main) where |
2 | 2 | ||
3 | import Control.Concurrent | ||
3 | import Network.BitTorrent | 4 | import Network.BitTorrent |
5 | import Network.BitTorrent.Sessions | ||
4 | import System.Environment | 6 | import System.Environment |
5 | 7 | ||
6 | main :: IO () | 8 | main :: IO () |
@@ -8,6 +10,9 @@ main = do | |||
8 | [path] <- getArgs | 10 | [path] <- getArgs |
9 | torrent <- fromFile path | 11 | torrent <- fromFile path |
10 | print (contentLayout "./" (tInfo torrent)) | 12 | print (contentLayout "./" (tInfo torrent)) |
13 | let loc = TorrentLoc path "/tmp" | ||
11 | 14 | ||
12 | withDefaultClient 3000 3001 $ \ client -> | 15 | withDefaultClient 51413 3000 $ \ client -> do |
13 | addTorrent client $ TorrentLoc path "/tmp" | 16 | openSwarmSession client loc |
17 | threadDelay 1000000000000 | ||
18 | return () | ||