diff options
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r-- | src/Network/BitTorrent.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs index e9b5f17d..f7c4c004 100644 --- a/src/Network/BitTorrent.hs +++ b/src/Network/BitTorrent.hs | |||
@@ -22,10 +22,11 @@ module Network.BitTorrent | |||
22 | 22 | ||
23 | -- * Peer to Peer | 23 | -- * Peer to Peer |
24 | , P2P | 24 | , P2P |
25 | , Event(..) | ||
25 | , PeerSession ( connectedPeerAddr, enabledExtensions ) | 26 | , PeerSession ( connectedPeerAddr, enabledExtensions ) |
26 | , Block(..), BlockIx(..) | 27 | , Block(..), BlockIx(..), ppBlock, ppBlockIx |
27 | 28 | ||
28 | , awaitEvent, signalEvent | 29 | , awaitEvent, yieldEvent |
29 | ) where | 30 | ) where |
30 | 31 | ||
31 | import Control.Monad | 32 | import Control.Monad |
@@ -34,6 +35,7 @@ import Data.IORef | |||
34 | import Data.Torrent | 35 | import Data.Torrent |
35 | import Network.BitTorrent.Internal | 36 | import Network.BitTorrent.Internal |
36 | import Network.BitTorrent.Exchange | 37 | import Network.BitTorrent.Exchange |
38 | import Network.BitTorrent.Exchange.Protocol | ||
37 | import Network.BitTorrent.Tracker | 39 | import Network.BitTorrent.Tracker |
38 | 40 | ||
39 | 41 | ||
@@ -49,10 +51,14 @@ discover swarm action = do | |||
49 | port | 51 | port |
50 | 52 | ||
51 | progress <- getCurrentProgress (clientSession swarm) | 53 | progress <- getCurrentProgress (clientSession swarm) |
54 | |||
55 | putStrLn "lookup peers" | ||
52 | withTracker progress conn $ \tses -> do | 56 | withTracker progress conn $ \tses -> do |
53 | forever $ do | 57 | forever $ do |
54 | addr <- getPeerAddr tses | 58 | addr <- getPeerAddr tses |
59 | putStrLn "connecting to peer" | ||
55 | withPeer swarm addr action | 60 | withPeer swarm addr action |
56 | 61 | ||
57 | 62 | ||
63 | |||
58 | port = 10000 | 64 | port = 10000 |