Tweaks to udp-echo.rkt

This commit is contained in:
Tony Garnock-Jones 2017-09-29 17:34:40 +01:00
parent d96477b9db
commit db333a266f
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,10 @@
#lang syndicate
(require/activate syndicate/drivers/udp)
(require syndicate/protocol/advertise)
(spawn (on (message (udp-packet $peer (udp-listener 5999) $body))
(printf "Received from ~a: ~v\n" peer body)
(send! (udp-packet (udp-listener 5999) peer body))))
(send! (udp-packet (udp-listener 5999) peer body)))
(on (asserted (advertise (udp-packet _ (udp-listener 5999) _)))
(printf "Socket is ready and will forward datagrams.\n")))