diff options
-rw-r--r-- | examples/dhtd.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index de1f11ab..68f91446 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -226,7 +226,8 @@ instance Kademlia Tox.Message where | |||
226 | instance Pretty (NodeId Tox.Message) where | 226 | instance Pretty (NodeId Tox.Message) where |
227 | instance Pretty (NodeInfo Tox.Message IPv4 ()) where | 227 | instance Pretty (NodeInfo Tox.Message IPv4 ()) where |
228 | instance Pretty (NodeInfo Tox.Message IPv4 Bool) where -- TODO | 228 | instance Pretty (NodeInfo Tox.Message IPv4 Bool) where -- TODO |
229 | instance Read (NodeId KMessageOf) where -- TODO | 229 | instance Read (NodeId KMessageOf) where |
230 | readsPrec d s = map (\(ih,s) -> (toNodeId (ih::InfoHash),s)) $ readsPrec d s | ||
230 | instance Read (NodeId Tox.Message) where -- TODO | 231 | instance Read (NodeId Tox.Message) where -- TODO |
231 | instance Serialize (FindNode Tox.Message IPv4) where | 232 | instance Serialize (FindNode Tox.Message IPv4) where |
232 | get = error "TODO get" | 233 | get = error "TODO get" |
@@ -275,7 +276,7 @@ clientSession bt tox signalQuit isBt sock n h = do | |||
275 | cmd (GenericDHT action) = cmd0 $ join $ either (flip runDHT action) (flip runDHT action) dht | 276 | cmd (GenericDHT action) = cmd0 $ join $ either (flip runDHT action) (flip runDHT action) dht |
276 | cmd (BtDHT action) = cmd0 $ join $ runDHT bt action | 277 | cmd (BtDHT action) = cmd0 $ join $ runDHT bt action |
277 | (c,args) = second (dropWhile isSpace) $ break isSpace line | 278 | (c,args) = second (dropWhile isSpace) $ break isSpace line |
278 | switchNetwork dest = clientSession bt tox signalQuit dest sock n h | 279 | switchNetwork dest = hPutClient h ("Network: "++if dest then "mainline" else "tox") >> clientSession bt tox signalQuit dest sock n h |
279 | case (c,args) of | 280 | case (c,args) of |
280 | 281 | ||
281 | ("bt", _) -> switchNetwork True | 282 | ("bt", _) -> switchNetwork True |