summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2018-05-29 20:53:30 +0000
committerJames Crayne <jim.crayne@gmail.com>2018-05-29 20:53:30 +0000
commit201d2b6c883b269e03038bde25e07fefaec7f8e4 (patch)
tree1b7b2b5e6091d2db879789bd216c57e849a227ad /examples
parent56ffbc788019235e3a9cce49411a696acb914304 (diff)
some junk, stash in testcookie for now
Diffstat (limited to 'examples')
-rw-r--r--examples/testcookie.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/testcookie.hs b/examples/testcookie.hs
index 5f5d4e83..4302ad35 100644
--- a/examples/testcookie.hs
+++ b/examples/testcookie.hs
@@ -11,6 +11,9 @@ import Network.Tox.DHT.Transport (Cookie(..))
11 11
12import Data.Serialize as S 12import Data.Serialize as S
13 13
14import Network.Tox.Crypto.Transport
15import Data.Word
16
14-- 17--
15-- Some relevant functions: 18-- Some relevant functions:
16-- 19--
@@ -50,4 +53,13 @@ main = do
50 exitFailure 53 exitFailure
51 Right n24' -> do 54 Right n24' -> do
52 putStrLn $ "n24' = " ++ show n24' 55 putStrLn $ "n24' = " ++ show n24'
53 if n24' == n24 then exitSuccess else exitFailure 56 if n24' == n24 then doContinue else exitFailure
57
58doContinue = do
59 let allmsgids = [Padding .. Messenger255]
60 allgrpmsgids = [Ping .. MessageName0xff]
61 allmsgs = map Msg allmsgids
62 ++ concatMap (\x -> [GrpMsg KnownLossless x,GrpMsg KnownLossy x]) allgrpmsgids
63 typmap :: [(MessageType,Word64)]
64 typmap = map (\x -> (x, toWord64 x)) allmsgs
65 mapM_ print typmap