summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-06-14 11:06:31 +0400
committerSam T <pxqr.sta@gmail.com>2013-06-14 11:06:31 +0400
commit07ac8270807140fac201b7c973e12f924ca4b36b (patch)
treeecab362addc9c7fd07ae59d9a0f14fd9bd0c24ee /src/Network/BitTorrent.hs
parent1fb701938aba43797124d2975c15f936ac71409a (diff)
~ Minor changes.
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r--src/Network/BitTorrent.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs
index 24d78e85..ce9f0149 100644
--- a/src/Network/BitTorrent.hs
+++ b/src/Network/BitTorrent.hs
@@ -45,6 +45,7 @@ import Network.BitTorrent.Exchange
45import Network.BitTorrent.Exchange.Protocol 45import Network.BitTorrent.Exchange.Protocol
46import Network.BitTorrent.Tracker 46import Network.BitTorrent.Tracker
47import Network.BitTorrent.Extension 47import Network.BitTorrent.Extension
48import Network.BitTorrent.Peer
48 49
49 50
50defaultClient :: IO ClientSession 51defaultClient :: IO ClientSession
@@ -55,7 +56,7 @@ defaultClient = newClient defaultThreadCount defaultExtensions
55 56
56discover :: SwarmSession -> P2P () -> IO () 57discover :: SwarmSession -> P2P () -> IO ()
57discover swarm action = do 58discover swarm action = do
58 port <- listener swarm action 59 port <- forkListener (error "discover")
59 60
60 let conn = TConnection (tAnnounce (torrentMeta swarm)) 61 let conn = TConnection (tAnnounce (torrentMeta swarm))
61 (tInfoHash (torrentMeta swarm)) 62 (tInfoHash (torrentMeta swarm))
@@ -69,9 +70,3 @@ discover swarm action = do
69 addr <- getPeerAddr tses 70 addr <- getPeerAddr tses
70 spawnP2P swarm addr $ do 71 spawnP2P swarm addr $ do
71 action 72 action
72
73listener :: SwarmSession -> P2P () -> IO PortNumber
74listener _ _ = do
75 -- TODO:
76-- forkIO loop
77 return 10000