From 4427cb321a6927b2dd8119e95e09f4998ff8a226 Mon Sep 17 00:00:00 2001 From: Sam T Date: Sun, 14 Jul 2013 19:34:36 +0400 Subject: ~ Use timestamp peer Id generator. --- examples/Main.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'examples') 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 @@ module Main (main) where +import Control.Concurrent import Network.BitTorrent +import Network.BitTorrent.Sessions import System.Environment main :: IO () @@ -8,6 +10,9 @@ main = do [path] <- getArgs torrent <- fromFile path print (contentLayout "./" (tInfo torrent)) + let loc = TorrentLoc path "/tmp" - withDefaultClient 3000 3001 $ \ client -> - addTorrent client $ TorrentLoc path "/tmp" + withDefaultClient 51413 3000 $ \ client -> do + openSwarmSession client loc + threadDelay 1000000000000 + return () -- cgit v1.2.3