From eba89394fa87256fd2ec71b67e667032e9e765dd Mon Sep 17 00:00:00 2001 From: Sam T Date: Tue, 11 Jun 2013 05:01:40 +0400 Subject: ~ Add exsamples. --- exsamples/Main.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 exsamples/Main.hs (limited to 'exsamples/Main.hs') diff --git a/exsamples/Main.hs b/exsamples/Main.hs new file mode 100644 index 00000000..3a347ab6 --- /dev/null +++ b/exsamples/Main.hs @@ -0,0 +1,20 @@ +module Main (main) where + +import Data.Bitfield +import Network.BitTorrent +import System.Environment + + +main :: IO () +main = do + [path] <- getArgs + Right torrent <- fromFile path + + client <- newClient [] + swarm <- newLeacher client torrent + + discover swarm $ \se -> do + peers <- getPeerList se + print peers + + print "Bye-bye!" \ No newline at end of file -- cgit v1.2.3