bob-msg.fs 628 Bytes
Newer Older
bernd's avatar
bernd committed
1 2 3
\ net2o tests - msg

require ../client-tests.fs
4
require ../test-keys.fs \ we want the test keys - never use this in production!
bernd's avatar
bernd committed
5

6
+db stat( \ )
bernd's avatar
bernd committed
7 8
script? [IF] +debug %droprate [THEN]

9 10
"test" dhtnick $!

bernd's avatar
bernd committed
11 12 13 14 15 16 17 18 19 20 21
i'm bob

init-client

!time

?nextarg [IF] net2o-host $! [THEN]
?nextarg [IF] s>number drop to net2o-port [THEN]

: c:msg-test ( -- )
    [: .time ." Message test" cr ;] $err
22
    "Hi Alice!" "alice" send-text-to o-timeout
bernd's avatar
bernd committed
23 24 25
    BEGIN  pad 100 accept cr dup WHILE  pad swap send-text  REPEAT
    drop ['] .time $err ;

bernd's avatar
bernd committed
26
script? [IF] announce-me ." connect alice?" key drop
bernd's avatar
bernd committed
27
    "alice" nat:connect c:msg-test c:disconnect bye [THEN]