mirror of
https://github.com/janet-lang/janet
synced 2025-10-17 08:47:39 +00:00
Get windows IOCP working for accept.
This also changes the api of servers slightly - in light of having support for ev tasks, it is probably better to remove the "simple" server code and replace it with some Janet or remove it all together. While convenient, it has issues with error handling and rigidity.
This commit is contained in:
@@ -33,9 +33,16 @@
|
||||
(:write stream b)
|
||||
(buffer/clear b)))
|
||||
|
||||
(def s (net/server "127.0.0.1" "8000" handler))
|
||||
(def s (net/server "127.0.0.1" "8000"))
|
||||
(assert s "made server 1")
|
||||
|
||||
(ev/go
|
||||
(coro
|
||||
(while (not (net/closed? s))
|
||||
(def conn (net/accept s))
|
||||
(unless conn (break))
|
||||
(ev/call handler conn))))
|
||||
|
||||
(defn test-echo [msg]
|
||||
(with [conn (net/connect "127.0.0.1" "8000")]
|
||||
(:write conn msg)
|
||||
|
Reference in New Issue
Block a user