diff options
author | Joe Crayne <joe@jerkface.net> | 2020-01-24 21:43:44 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-25 19:18:12 -0500 |
commit | 81489b13ee734bf5c618e1b826971725df8ed808 (patch) | |
tree | eb45f4806aee2b17394a153b7f99fa7b7287a8bf /dht/examples | |
parent | 41b1a490c7b516c0feb0251fdb7723f045773f23 (diff) |
Moved parse-error printing from addHandler to forkListener.
Diffstat (limited to 'dht/examples')
-rw-r--r-- | dht/examples/dhtd.hs | 2 | ||||
-rw-r--r-- | dht/examples/tcpclient.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/dht/examples/dhtd.hs b/dht/examples/dhtd.hs index de315e35..0dcb4237 100644 --- a/dht/examples/dhtd.hs +++ b/dht/examples/dhtd.hs | |||
@@ -1803,7 +1803,7 @@ main = do | |||
1803 | fromMaybe bail $ msock <&> \(udp,sock) -> do | 1803 | fromMaybe bail $ msock <&> \(udp,sock) -> do |
1804 | addr <- getSocketName sock | 1804 | addr <- getSocketName sock |
1805 | (bt,btR,btBootstrap4, btBootstrap6,quitBtClient) <- Mainline.newClient swarms addr udp | 1805 | (bt,btR,btBootstrap4, btBootstrap6,quitBtClient) <- Mainline.newClient swarms addr udp |
1806 | quitBt <- forkListener "bt" (clientNet bt) | 1806 | quitBt <- forkListener "bt" (dput XBitTorrent . mappend "bt-parse: ") (clientNet bt) |
1807 | mainlineSearches <- atomically $ newTVar Map.empty | 1807 | mainlineSearches <- atomically $ newTVar Map.empty |
1808 | peerPort <- atomically $ newTVar 6881 -- BitTorrent client TCP port. | 1808 | peerPort <- atomically $ newTVar 6881 -- BitTorrent client TCP port. |
1809 | let mainlineDHT bkts wantip = DHT | 1809 | let mainlineDHT bkts wantip = DHT |
diff --git a/dht/examples/tcpclient.hs b/dht/examples/tcpclient.hs index d168b1fb..858a617d 100644 --- a/dht/examples/tcpclient.hs +++ b/dht/examples/tcpclient.hs | |||
@@ -16,7 +16,7 @@ main = do | |||
16 | setVerbose XUnexpected | 16 | setVerbose XUnexpected |
17 | crypto <- newCrypto | 17 | crypto <- newCrypto |
18 | (_,client) <- newClient crypto id (\cb p -> cb (Just (False,p))) | 18 | (_,client) <- newClient crypto id (\cb p -> cb (Just (False,p))) |
19 | quitTCP <- forkListener "TCP-recv" (addHandler print (handleMessage client) $ clientNet client) | 19 | quitTCP <- forkListener "TCP-recv" (dput XTCP . (++) "tcp-parse: ") (addHandler print (handleMessage client) $ clientNet client) |
20 | args <- getArgs | 20 | args <- getArgs |
21 | let addr = read $ args !! 0 | 21 | let addr = read $ args !! 0 |
22 | 22 | ||