diff options
author | joe <joe@jerkface.net> | 2018-06-26 17:29:30 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-26 17:29:30 -0400 |
commit | 2b2627f11e4f7544d86c78a474872f02665ef109 (patch) | |
tree | bc516de9e87e81d86827cb616c14ae63897b2500 /examples/testTox.hs | |
parent | 7123e72a7256a146d2d756394eab863c5d536fc9 (diff) |
Thread report in test program.
Diffstat (limited to 'examples/testTox.hs')
-rw-r--r-- | examples/testTox.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/testTox.hs b/examples/testTox.hs index 45bc661e..53ed25dc 100644 --- a/examples/testTox.hs +++ b/examples/testTox.hs | |||
@@ -1,4 +1,5 @@ | |||
1 | {-# LANGUAGE NamedFieldPuns #-} | 1 | {-# LANGUAGE NamedFieldPuns #-} |
2 | import Control.Concurrent (threadDelay) | ||
2 | import Control.Concurrent.STM.TChan | 3 | import Control.Concurrent.STM.TChan |
3 | import Control.Concurrent.STM.TMChan | 4 | import Control.Concurrent.STM.TMChan |
4 | import Control.Concurrent.STM.TVar | 5 | import Control.Concurrent.STM.TVar |
@@ -6,6 +7,8 @@ import Control.Concurrent.Supply | |||
6 | import Control.Monad.STM | 7 | import Control.Monad.STM |
7 | import Crypto.Tox | 8 | import Crypto.Tox |
8 | import qualified Data.IntMap.Strict as IntMap | 9 | import qualified Data.IntMap.Strict as IntMap |
10 | import DebugUtil | ||
11 | import DPut | ||
9 | import Network.QueryResponse | 12 | import Network.QueryResponse |
10 | import Network.Socket | 13 | import Network.Socket |
11 | import Network.Tox | 14 | import Network.Tox |
@@ -14,7 +17,6 @@ import qualified Network.Tox.Crypto.Handlers as CH | |||
14 | import Network.Tox.Crypto.Transport | 17 | import Network.Tox.Crypto.Transport |
15 | import Network.Tox.DHT.Handlers as DHT | 18 | import Network.Tox.DHT.Handlers as DHT |
16 | import Network.Tox.Onion.Transport (UDPTransport) | 19 | import Network.Tox.Onion.Transport (UDPTransport) |
17 | import DPut | ||
18 | 20 | ||
19 | 21 | ||
20 | makeToxNode :: UDPTransport -> Maybe SecretKey -> IO (Tox extra) | 22 | makeToxNode :: UDPTransport -> Maybe SecretKey -> IO (Tox extra) |
@@ -71,10 +73,15 @@ main = do | |||
71 | (a_quit,_,_) <- forkTox a_Ct7g5azVcJ8KnvxzbXs9GqeqcjrP7VdZXIC'uHeTlRf False | 73 | (a_quit,_,_) <- forkTox a_Ct7g5azVcJ8KnvxzbXs9GqeqcjrP7VdZXIC'uHeTlRf False |
72 | (b_quit,_,_) <- forkTox b_OM7znaPMYkTbm'9GcZJAdnDATXmZxZ9fnaSTP3qNCZk False | 74 | (b_quit,_,_) <- forkTox b_OM7znaPMYkTbm'9GcZJAdnDATXmZxZ9fnaSTP3qNCZk False |
73 | 75 | ||
76 | threadReport False >>= putStrLn | ||
74 | 77 | ||
75 | DHT.ping (toxDHT a_Ct7g5azVcJ8KnvxzbXs9GqeqcjrP7VdZXIC'uHeTlRf) b | 78 | DHT.ping (toxDHT a_Ct7g5azVcJ8KnvxzbXs9GqeqcjrP7VdZXIC'uHeTlRf) b |
76 | 79 | ||
77 | putStrLn "Type Enter to quit..." | 80 | putStrLn "Type Enter to quit..." |
78 | getLine | 81 | getLine |
79 | 82 | ||
80 | return () | 83 | a_quit |
84 | b_quit | ||
85 | |||
86 | threadDelay 500000 | ||
87 | threadReport False >>= putStrLn | ||