1
0
mirror of https://github.com/janet-lang/janet synced 2025-12-14 04:28:06 +00:00
This commit is contained in:
Calvin Rose
2025-02-15 23:22:12 -06:00
parent 53bcc15207
commit 2e6001316a
4 changed files with 61 additions and 14 deletions

View File

@@ -3877,8 +3877,8 @@
(compwhen (dyn 'net/listen)
(defn net/server
"Start a server asynchronously with `net/listen` and `net/accept-loop`. Returns the new server stream."
[host port &opt handler type]
(def s (net/listen host port type))
[host port &opt handler type no-reuse]
(def s (net/listen host port type no-reuse))
(if handler
(ev/go (fn [] (net/accept-loop s handler))))
s))