1
0
mirror of https://github.com/janet-lang/janet synced 2025-02-05 11:40:00 +00:00
janet/examples/udpserver.janet

7 lines
199 B
Plaintext
Raw Normal View History

(def server (net/listen "127.0.0.1" "8009" :datagram))
2020-06-01 22:06:27 -05:00
(while true
(def buf @"")
(def who (:recv-from server 1024 buf))
(printf "got %q from %v, echoing!" buf who)
(:send-to server who buf))