summaryrefslogtreecommitdiff
path: root/exsamples
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-06-11 07:52:20 +0400
committerSam T <pxqr.sta@gmail.com>2013-06-11 07:52:20 +0400
commit0254b200cd4aa5245c37c7a650f8b14567a3b4cf (patch)
tree13ed575f9ffa3cb9e1dbd39b51fc48845125ea5a /exsamples
parent1b4fdf35dd6c21d600130c42a1bcb5c56b25afa6 (diff)
~ Minor changes.
Diffstat (limited to 'exsamples')
-rw-r--r--exsamples/Main.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/exsamples/Main.hs b/exsamples/Main.hs
index b0224886..81958613 100644
--- a/exsamples/Main.hs
+++ b/exsamples/Main.hs
@@ -1,8 +1,10 @@
1module Main (main) where 1module Main (main) where
2 2
3import Control.Concurrent
3import Data.Bitfield 4import Data.Bitfield
4import Network.BitTorrent 5import Network.BitTorrent
5import System.Environment 6import System.Environment
7import Control.Monad.Reader
6 8
7 9
8main :: IO () 10main :: IO ()
@@ -13,8 +15,11 @@ main = do
13 client <- newClient [] 15 client <- newClient []
14 swarm <- newLeacher client torrent 16 swarm <- newLeacher client torrent
15 17
16 discover swarm $ \se -> do 18 discover swarm $ do
17 peers <- getPeerList se 19 addr <- asks connectedPeerAddr
18 print peers 20 liftIO $ print $ "connected to" ++ show addr
21 e <- awaitEvent
22 liftIO $ print e
23 liftIO $ threadDelay (100 * 1000000)
19 24
20 print "Bye-bye!" \ No newline at end of file 25 print "Bye-bye! =_=" \ No newline at end of file