1
0
mirror of https://github.com/janet-lang/janet synced 2024-10-31 22:16:16 +00:00
janet/examples/udpserver.janet
2020-06-02 19:47:50 -05:00

7 lines
203 B
Clojure

(def server (net/server "127.0.0.1" "8009" nil :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))