summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/DHT/Session.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/DHT/Session.hs')
-rw-r--r--src/Network/BitTorrent/DHT/Session.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs
index 69970918..43bd65e5 100644
--- a/src/Network/BitTorrent/DHT/Session.hs
+++ b/src/Network/BitTorrent/DHT/Session.hs
@@ -33,8 +33,8 @@ module Network.BitTorrent.DHT.Session
33 -- ** Initialization 33 -- ** Initialization
34 , LogFun 34 , LogFun
35 , NodeHandler 35 , NodeHandler
36 , startNode 36 , newNode
37 , stopNode 37 , closeNode
38 38
39 -- * DHT 39 -- * DHT
40 -- | Use @asks options@ to get options passed to 'startNode' 40 -- | Use @asks options@ to get options passed to 'startNode'
@@ -294,13 +294,13 @@ type NodeHandler ip = Handler (DHT ip)
294-- | Run DHT session. You /must/ properly close session using 294-- | Run DHT session. You /must/ properly close session using
295-- 'stopNode' function, otherwise socket or other scarce resources may 295-- 'stopNode' function, otherwise socket or other scarce resources may
296-- leak. 296-- leak.
297startNode :: Address ip 297newNode :: Address ip
298 => [NodeHandler ip] -- ^ handlers to run on accepted queries; 298 => [NodeHandler ip] -- ^ handlers to run on accepted queries;
299 -> Options -- ^ various dht options; 299 -> Options -- ^ various dht options;
300 -> NodeAddr ip -- ^ node address to bind; 300 -> NodeAddr ip -- ^ node address to bind;
301 -> LogFun -- ^ 301 -> LogFun -- ^
302 -> IO (Node ip) -- ^ a new DHT node running at given address. 302 -> IO (Node ip) -- ^ a new DHT node running at given address.
303startNode hs opts naddr logger = do 303newNode hs opts naddr logger = do
304 s <- createInternalState 304 s <- createInternalState
305 runInternalState initNode s 305 runInternalState initNode s
306 `onException` closeInternalState s 306 `onException` closeInternalState s
@@ -323,8 +323,8 @@ startNode hs opts naddr logger = do
323 323
324-- | Some resources like listener thread may live for 324-- | Some resources like listener thread may live for
325-- some short period of time right after this DHT session closed. 325-- some short period of time right after this DHT session closed.
326stopNode :: Node ip -> IO () 326closeNode :: Node ip -> IO ()
327stopNode Node {..} = closeInternalState resources 327closeNode Node {..} = closeInternalState resources
328 328
329-- | Run DHT operation on the given session. 329-- | Run DHT operation on the given session.
330runDHT :: Node ip -> DHT ip a -> IO a 330runDHT :: Node ip -> DHT ip a -> IO a