diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 959383dc..1223edc8 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -97,6 +97,7 @@ import qualified Network.Tox.Onion.Transport as Tox | |||
97 | import qualified Network.Tox.Onion.Handlers as Tox | 97 | import qualified Network.Tox.Onion.Handlers as Tox |
98 | import qualified Network.Tox.Crypto.Transport as Tox | 98 | import qualified Network.Tox.Crypto.Transport as Tox |
99 | import qualified Network.Tox.TCP as TCP | 99 | import qualified Network.Tox.TCP as TCP |
100 | import qualified TCPProber as TCP | ||
100 | import Data.Typeable | 101 | import Data.Typeable |
101 | import Network.Tox.ContactInfo as Tox | 102 | import Network.Tox.ContactInfo as Tox |
102 | import OnionRouter | 103 | import OnionRouter |
@@ -1490,6 +1491,7 @@ initTox opts ssvar keysdb mbxmpp invc = case porttox opts of | |||
1490 | Want_IP4 -> toxStrap4 | 1491 | Want_IP4 -> toxStrap4 |
1491 | Want_IP6 -> toxStrap6 | 1492 | Want_IP6 -> toxStrap6 |
1492 | } | 1493 | } |
1494 | tcpprober = tcpProber $ Tox.toxOnionRoutes tox | ||
1493 | tcpclient = tcpKademliaClient $ Tox.toxOnionRoutes tox | 1495 | tcpclient = tcpKademliaClient $ Tox.toxOnionRoutes tox |
1494 | tcpRefresher = tcpBucketRefresher $ Tox.toxOnionRoutes tox | 1496 | tcpRefresher = tcpBucketRefresher $ Tox.toxOnionRoutes tox |
1495 | tcpDHT = DHT | 1497 | tcpDHT = DHT |
@@ -1500,9 +1502,9 @@ initTox opts ssvar keysdb mbxmpp invc = case porttox opts of | |||
1500 | , pingShowResult = show | 1502 | , pingShowResult = show |
1501 | } | 1503 | } |
1502 | , dhtQuery = Map.singleton "node" DHTQuery | 1504 | , dhtQuery = Map.singleton "node" DHTQuery |
1503 | { qsearch = TCP.nodeSearch tcpclient | 1505 | { qsearch = TCP.nodeSearch tcpprober tcpclient |
1504 | , qhandler = \ni nid -> do | 1506 | , qhandler = \ni nid -> do |
1505 | ns <- R.kclosest (searchSpace $ TCP.nodeSearch tcpclient) searchK nid | 1507 | ns <- R.kclosest (searchSpace $ TCP.nodeSearch tcpprober tcpclient) searchK nid |
1506 | <$> atomically (readTVar $ refreshBuckets tcpRefresher) | 1508 | <$> atomically (readTVar $ refreshBuckets tcpRefresher) |
1507 | return (ns,ns,Just ()) | 1509 | return (ns,ns,Just ()) |
1508 | , qshowR = show -- TCP.NodeInfo | 1510 | , qshowR = show -- TCP.NodeInfo |