diff options
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/Client.hs | 1 | ||||
-rw-r--r-- | src/Network/BitTorrent/DHT.hs | 1 | ||||
-rw-r--r-- | src/Network/BitTorrent/DHT/Query.hs | 1 | ||||
-rw-r--r-- | src/Network/BitTorrent/DHT/Session.hs | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs index 0d2e14ca..9b53ad6d 100644 --- a/src/Network/BitTorrent/Client.hs +++ b/src/Network/BitTorrent/Client.hs | |||
@@ -112,6 +112,7 @@ closeClient :: Client -> IO () | |||
112 | closeClient Client {..} = do | 112 | closeClient Client {..} = do |
113 | Exchange.closeManager exchangeManager | 113 | Exchange.closeManager exchangeManager |
114 | Tracker.closeManager trackerManager | 114 | Tracker.closeManager trackerManager |
115 | DHT.stopNode clientNode | ||
115 | return () | 116 | return () |
116 | -- closeNode clientNode | 117 | -- closeNode clientNode |
117 | 118 | ||
diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs index 6c78d992..080a0fc0 100644 --- a/src/Network/BitTorrent/DHT.hs +++ b/src/Network/BitTorrent/DHT.hs | |||
@@ -45,6 +45,7 @@ module Network.BitTorrent.DHT | |||
45 | , Node | 45 | , Node |
46 | , handlers | 46 | , handlers |
47 | , startNode | 47 | , startNode |
48 | , stopNode | ||
48 | 49 | ||
49 | -- ** Monad | 50 | -- ** Monad |
50 | , MonadDHT (..) | 51 | , MonadDHT (..) |
diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index 07fb80c2..714e9559 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs | |||
@@ -80,6 +80,7 @@ announceH = nodeHandler $ \ naddr @ NodeAddr {..} (Announce {..}) -> do | |||
80 | insertPeer topic peerAddr | 80 | insertPeer topic peerAddr |
81 | return Announced | 81 | return Announced |
82 | 82 | ||
83 | -- | Includes all query handlers. | ||
83 | handlers :: Address ip => [NodeHandler ip] | 84 | handlers :: Address ip => [NodeHandler ip] |
84 | handlers = [pingH, findNodeH, getPeersH, announceH] | 85 | handlers = [pingH, findNodeH, getPeersH, announceH] |
85 | 86 | ||
diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index 1bc9e697..b4ff0208 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs | |||
@@ -308,6 +308,7 @@ startNode hs opts naddr logger = do | |||
308 | stopNode :: Node ip -> IO () | 308 | stopNode :: Node ip -> IO () |
309 | stopNode Node {..} = closeInternalState resources | 309 | stopNode Node {..} = closeInternalState resources |
310 | 310 | ||
311 | -- | Run DHT operation on the given session. | ||
311 | runDHT :: Node ip -> DHT ip a -> IO a | 312 | runDHT :: Node ip -> DHT ip a -> IO a |
312 | runDHT node action = runReaderT (unDHT action) node | 313 | runDHT node action = runReaderT (unDHT action) node |
313 | {-# INLINE runDHT #-} | 314 | {-# INLINE runDHT #-} |