diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-07 00:52:15 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-07 00:52:15 +0400 |
commit | e95d39a49d476e09b7d8da82bac514284f9d4e0f (patch) | |
tree | 37f073b266d724aabcc40ba6cd4e1323446de127 /src/Network/BitTorrent.hs | |
parent | 05787c18b88db130e178b19aee09c21398a16256 (diff) |
~ Reassign listener to client session.
Diffstat (limited to 'src/Network/BitTorrent.hs')
-rw-r--r-- | src/Network/BitTorrent.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs index bb8eb800..ef144f1f 100644 --- a/src/Network/BitTorrent.hs +++ b/src/Network/BitTorrent.hs | |||
@@ -102,15 +102,13 @@ defaultClient = newClient defaultThreadCount defaultExtensions | |||
102 | -- thus we can obtain an unified interface | 102 | -- thus we can obtain an unified interface |
103 | 103 | ||
104 | discover :: SwarmSession -> P2P () -> IO () | 104 | discover :: SwarmSession -> P2P () -> IO () |
105 | discover swarm action = {-# SCC discover #-} do | 105 | discover swarm @ SwarmSession {..} action = {-# SCC discover #-} do |
106 | port <- forkListener (error "discover") | 106 | let conn = TConnection (tAnnounce torrentMeta) |
107 | (tInfoHash torrentMeta) | ||
108 | (clientPeerId clientSession) | ||
109 | (listenerPort clientSession) | ||
107 | 110 | ||
108 | let conn = TConnection (tAnnounce (torrentMeta swarm)) | 111 | progress <- getCurrentProgress clientSession |
109 | (tInfoHash (torrentMeta swarm)) | ||
110 | (clientPeerId (clientSession swarm)) | ||
111 | port | ||
112 | |||
113 | progress <- getCurrentProgress (clientSession swarm) | ||
114 | 112 | ||
115 | withTracker progress conn $ \tses -> do | 113 | withTracker progress conn $ \tses -> do |
116 | forever $ do | 114 | forever $ do |