Hi Edwin,

> can i make the picoLisp app server not fork? that is, when i run

There was a discussion about that here in 2008. You can easily make a
non-forking server by not calling the standard 'server' function which
automatically forks upon a connect, but use a 'listen'ing loop instead:

################################################################
#!bin/picolisp lib.l

(load "ext.l" "lib/http.l" "lib/xhtml.l")

(allowed () "@start") 

(de start ()
   (html 0 "Hello" NIL NIL
      "Hello World!" ) )

(let (P (port 8080)  H "@start")
   (setq *Home (cons H (chop H)))
   (loop
      (when (listen P)
         (http @)
         (close @) ) ) )
################################################################

This loops infinitely, listening on port 8080. When a request arrives,
it is handled, and the connection closed.

This works, but has disadvantages like denying further requests while a
transaction is running, and not being able to keep state information in
a session the way the child processes do after a fork. For certain
special cases it might well make sense, though.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to