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:
@@ -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"))))
|
||||
|
Reference in New Issue
Block a user