1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-04 20:08:04 +00:00

Add timeouts to net functions.

Further debugging of the general timeout system, as well
as having a single fiber wait on multiple state machines (select).
This commit is contained in:
Calvin Rose
2020-07-19 19:41:12 -05:00
parent df145f4bc9
commit 553b4d9428
9 changed files with 66 additions and 36 deletions

View File

@@ -14,4 +14,7 @@
# Run server.
(let [server (net/server "127.0.0.1" "8000")]
(print "Starting echo server on 127.0.0.1:8000")
(while true (ev/call handler (:accept server))))
(forever
(if-let [conn (:accept server 2.8)]
(ev/call handler conn)
(print "no new connections"))))