1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-07 21:36:08 +00:00

Initial UDP implementation.

This commit is contained in:
Calvin Rose
2020-06-01 22:06:27 -05:00
parent 3f434f2a44
commit ec0d0ba368
6 changed files with 240 additions and 71 deletions

6
examples/udpserver.janet Normal file
View File

@@ -0,0 +1,6 @@
(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))