diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/DHT.hs | 1 | ||||
-rw-r--r-- | src/Network/DatagramServer.hs | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs index b130e727..1a67c7c4 100644 --- a/src/Network/BitTorrent/DHT.hs +++ b/src/Network/BitTorrent/DHT.hs | |||
@@ -124,6 +124,7 @@ dht :: | |||
124 | , WireFormat raw dht | 124 | , WireFormat raw dht |
125 | , Show u | 125 | , Show u |
126 | , Default u | 126 | , Default u |
127 | , Typeable dht | ||
127 | ) | 128 | ) |
128 | => Options -- ^ normally you need to use 'Data.Default.def'; | 129 | => Options -- ^ normally you need to use 'Data.Default.def'; |
129 | -> NodeAddr ip -- ^ address to bind this node; | 130 | -> NodeAddr ip -- ^ address to bind this node; |
diff --git a/src/Network/DatagramServer.hs b/src/Network/DatagramServer.hs index 55a26e58..891417d4 100644 --- a/src/Network/DatagramServer.hs +++ b/src/Network/DatagramServer.hs | |||
@@ -375,6 +375,7 @@ queryK mgr@Manager{..} dest params kont = do | |||
375 | Method meth = method :: Method msg a b | 375 | Method meth = method :: Method msg a b |
376 | signature = querySignature meth tid addr | 376 | signature = querySignature meth tid addr |
377 | logMsg 'D' "query.sending" signature | 377 | logMsg 'D' "query.sending" signature |
378 | -- [Debug#query.sending] &MessageType 0 #312020202020202020202020202020202020202020202020 @77.37.142.179:33445 | ||
378 | 379 | ||
379 | mres <- liftIO $ do | 380 | mres <- liftIO $ do |
380 | ares <- registerQuery (tid, addr) pendingCalls | 381 | ares <- registerQuery (tid, addr) pendingCalls |
@@ -591,15 +592,17 @@ listener mgr@Manager{..} hs p = do | |||
591 | 592 | ||
592 | -- | Should be run before any 'query', otherwise they will never | 593 | -- | Should be run before any 'query', otherwise they will never |
593 | -- succeed. | 594 | -- succeed. |
594 | listen :: ( WireFormat raw msg | 595 | listen :: forall raw msg. |
596 | ( WireFormat raw msg | ||
595 | , Ord (TransactionID msg) | 597 | , Ord (TransactionID msg) |
596 | , Eq (QueryMethod msg) | 598 | , Eq (QueryMethod msg) |
597 | , Show (QueryMethod msg) | 599 | , Show (QueryMethod msg) |
598 | , Serialize (TransactionID msg) | 600 | , Serialize (TransactionID msg) |
601 | , Typeable msg | ||
599 | ) => Manager raw msg -> [Handler IO msg raw] -> Protocol raw msg -> IO () | 602 | ) => Manager raw msg -> [Handler IO msg raw] -> Protocol raw msg -> IO () |
600 | listen mgr@Manager{..} hs p = do | 603 | listen mgr@Manager{..} hs p = do |
601 | tid <- fork $ do | 604 | tid <- fork $ do |
602 | myThreadId >>= liftIO . flip labelThread "KRPC.listen" | 605 | myThreadId >>= liftIO . flip labelThread ("KRPC.listen." ++ (L.last $ L.words $ show $ typeOf (Proxy :: Proxy msg))) |
603 | listener mgr hs p `Lifted.finally` | 606 | listener mgr hs p `Lifted.finally` |
604 | liftIO (takeMVar listenerThread) | 607 | liftIO (takeMVar listenerThread) |
605 | liftIO $ putMVar listenerThread tid | 608 | liftIO $ putMVar listenerThread tid |