summaryrefslogtreecommitdiff
path: root/exsamples/Main.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-06-11 05:01:40 +0400
committerSam T <pxqr.sta@gmail.com>2013-06-11 05:01:40 +0400
commiteba89394fa87256fd2ec71b67e667032e9e765dd (patch)
tree45d97e83bcdc05a9a51cec2edffe256949df1426 /exsamples/Main.hs
parent64de83063c21a963b9c7cdec82cfe2b036166c15 (diff)
~ Add exsamples.
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