Commit 30412fa83fe31ffb7ddaae5f43425c0ad421a102

Thomas de Grivel 2024-12-03T14:03:55

wip httpd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index c7bfa6c..f276198 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -123,11 +123,10 @@ defmodule HTTPd do
   def server = fn (host, port) {
     def socket = Socket.listen(host, port)
     daemonize()
-    i = 1
-    while i > 0 do
+    threads = List.map(List.count(1), fn (x) {
       Thread.new(server_thread)
-      i = i - 1
-    end
+    })
+    List.map(threads, Thread.delete)
   }
 
   def main = fn {