summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/testTox.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/testTox.hs b/examples/testTox.hs
index e82ca2d3..67c4daef 100644
--- a/examples/testTox.hs
+++ b/examples/testTox.hs
@@ -34,7 +34,8 @@ import qualified Data.HashMap.Strict as HashMap
34import qualified Data.Map.Strict as Map 34import qualified Data.Map.Strict as Map
35import Data.Time.Clock.POSIX 35import Data.Time.Clock.POSIX
36import System.Exit 36import System.Exit
37 37import Data.Dependent.Sum
38import Data.Tox.Msg
38 39
39makeToxNode :: UDPTransport -> Maybe SecretKey 40makeToxNode :: UDPTransport -> Maybe SecretKey
40 -> ( ContactInfo extra -> SockAddr -> Session -> IO () ) 41 -> ( ContactInfo extra -> SockAddr -> Session -> IO () )
@@ -46,6 +47,7 @@ makeToxNode udp sec onSessionF = do
46 onSessionF 47 onSessionF
47 sec 48 sec
48 udp 49 udp
50 (\_ _ -> return ())
49 51
50 52
51setToxID :: Tox () -> Maybe SecretKey -> IO () 53setToxID :: Tox () -> Maybe SecretKey -> IO ()
@@ -161,7 +163,7 @@ main = do
161 case Map.lookup b_public mp_a of 163 case Map.lookup b_public mp_a of
162 Just [session] -> do 164 Just [session] -> do
163 dput XUnused "----------------- HOWDY ---------------" 165 dput XUnused "----------------- HOWDY ---------------"
164 sendMessage (sTransport session) () (UpToN MESSAGE "Howdy") 166 sendMessage (sTransport session) () (Pkt MESSAGE :=> "Howdy")
165 Just xs -> dput XUnused "Unexpectedly a has TOO MANY sesions for b" 167 Just xs -> dput XUnused "Unexpectedly a has TOO MANY sesions for b"
166 Nothing -> dput XUnused "Unexpectedly a has NO session for b" 168 Nothing -> dput XUnused "Unexpectedly a has NO session for b"
167 -- b says "Hey you!" 169 -- b says "Hey you!"
@@ -169,7 +171,7 @@ main = do
169 case Map.lookup a_public mp_b of 171 case Map.lookup a_public mp_b of
170 Just [session] -> do 172 Just [session] -> do
171 dput XUnused "----------------- HEY YOU ---------------" 173 dput XUnused "----------------- HEY YOU ---------------"
172 sendMessage (sTransport session) () (UpToN MESSAGE "Hey you!") 174 sendMessage (sTransport session) () (Pkt MESSAGE :=> "Hey you!")
173 Just xs -> dput XUnused "Unexpectedly b has TOO MANY sesions for a" 175 Just xs -> dput XUnused "Unexpectedly b has TOO MANY sesions for a"
174 Nothing -> dput XUnused "Unexpectedly b has NO session for a" 176 Nothing -> dput XUnused "Unexpectedly b has NO session for a"
175 177