diff options
Diffstat (limited to 'src/Network/BitTorrent/Client.hs')
-rw-r--r-- | src/Network/BitTorrent/Client.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs index 7a50b6ba..349283c3 100644 --- a/src/Network/BitTorrent/Client.hs +++ b/src/Network/BitTorrent/Client.hs | |||
@@ -39,7 +39,6 @@ import Control.Exception | |||
39 | import Control.Concurrent | 39 | import Control.Concurrent |
40 | import Control.Monad.Logger | 40 | import Control.Monad.Logger |
41 | import Control.Monad.Trans | 41 | import Control.Monad.Trans |
42 | import Control.Monad.Trans.Resource | ||
43 | 42 | ||
44 | import Data.Default | 43 | import Data.Default |
45 | import Data.HashMap.Strict as HM | 44 | import Data.HashMap.Strict as HM |
@@ -84,15 +83,15 @@ exchangeOptions pid Options {..} = Exchange.Options | |||
84 | , optBacklog = optBacklog def | 83 | , optBacklog = optBacklog def |
85 | } | 84 | } |
86 | 85 | ||
87 | --connHandler :: HashMap InfoHash Handle -> Handler | 86 | connHandler :: MVar (HashMap InfoHash Handle) -> Exchange.Handler |
88 | connHandler tmap = undefined | 87 | connHandler _tmap = undefined |
89 | 88 | ||
90 | newClient :: Options -> LogFun -> IO Client | 89 | newClient :: Options -> LogFun -> IO Client |
91 | newClient opts @ Options {..} logger = do | 90 | newClient opts @ Options {..} logger = do |
92 | pid <- genPeerId | 91 | pid <- genPeerId |
93 | tmap <- newMVar HM.empty | 92 | tmap <- newMVar HM.empty |
94 | tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort) | 93 | tmgr <- Tracker.newManager def (PeerInfo pid Nothing optPort) |
95 | emgr <- Exchange.newManager (exchangeOptions pid opts) connHandler | 94 | emgr <- Exchange.newManager (exchangeOptions pid opts) (connHandler tmap) |
96 | node <- do | 95 | node <- do |
97 | node <- startNode defaultHandlers def optNodeAddr logger | 96 | node <- startNode defaultHandlers def optNodeAddr logger |
98 | runDHT node $ bootstrap (maybeToList optBootNode) | 97 | runDHT node $ bootstrap (maybeToList optBootNode) |