From 0254b200cd4aa5245c37c7a650f8b14567a3b4cf Mon Sep 17 00:00:00 2001 From: Sam T Date: Tue, 11 Jun 2013 07:52:20 +0400 Subject: ~ Minor changes. --- exsamples/Main.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'exsamples/Main.hs') 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 @@ module Main (main) where +import Control.Concurrent import Data.Bitfield import Network.BitTorrent import System.Environment +import Control.Monad.Reader main :: IO () @@ -13,8 +15,11 @@ main = do client <- newClient [] swarm <- newLeacher client torrent - discover swarm $ \se -> do - peers <- getPeerList se - print peers + discover swarm $ do + addr <- asks connectedPeerAddr + liftIO $ print $ "connected to" ++ show addr + e <- awaitEvent + liftIO $ print e + liftIO $ threadDelay (100 * 1000000) - print "Bye-bye!" \ No newline at end of file + print "Bye-bye! =_=" \ No newline at end of file -- cgit v1.2.3