summaryrefslogtreecommitdiff
path: root/exsamples/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'exsamples/Main.hs')
-rw-r--r--exsamples/Main.hs20
1 files changed, 20 insertions, 0 deletions
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 @@
1module Main (main) where
2
3import Data.Bitfield
4import Network.BitTorrent
5import System.Environment
6
7
8main :: IO ()
9main = do
10 [path] <- getArgs
11 Right torrent <- fromFile path
12
13 client <- newClient []
14 swarm <- newLeacher client torrent
15
16 discover swarm $ \se -> do
17 peers <- getPeerList se
18 print peers
19
20 print "Bye-bye!" \ No newline at end of file