diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-06-14 11:06:31 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-06-14 11:06:31 +0400 |
commit | 07ac8270807140fac201b7c973e12f924ca4b36b (patch) | |
tree | ecab362addc9c7fd07ae59d9a0f14fd9bd0c24ee /src/Network/BitTorrent.hs | |
parent | 1fb701938aba43797124d2975c15f936ac71409a (diff) |
~ Minor changes.
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r-- | src/Network/BitTorrent.hs | 9 |
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 | |||
45 | import Network.BitTorrent.Exchange.Protocol | 45 | import Network.BitTorrent.Exchange.Protocol |
46 | import Network.BitTorrent.Tracker | 46 | import Network.BitTorrent.Tracker |
47 | import Network.BitTorrent.Extension | 47 | import Network.BitTorrent.Extension |
48 | import Network.BitTorrent.Peer | ||
48 | 49 | ||
49 | 50 | ||
50 | defaultClient :: IO ClientSession | 51 | defaultClient :: IO ClientSession |
@@ -55,7 +56,7 @@ defaultClient = newClient defaultThreadCount defaultExtensions | |||
55 | 56 | ||
56 | discover :: SwarmSession -> P2P () -> IO () | 57 | discover :: SwarmSession -> P2P () -> IO () |
57 | discover swarm action = do | 58 | discover 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 | |||
73 | listener :: SwarmSession -> P2P () -> IO PortNumber | ||
74 | listener _ _ = do | ||
75 | -- TODO: | ||
76 | -- forkIO loop | ||
77 | return 10000 | ||