1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-18 06:34:48 +00:00
janet/examples/udpserver.janet

7 lines
199 B
Clojure

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