Skip to content
Chris Petersen edited this page Oct 8, 2015 · 2 revisions

Accept a connection from the web server.

Example

(let loop ()
  (if (>= (FCGI-Accept) 0) (begin
     (set! count (+ count 1))
     (FCGI-display "Content-type: text/html\r\n\r\n")
    (FCGI-display (with-output-to-string "" (lambda ()
      (sxml->xml `(html 
        (head (title "LambdaNative FastCGI"))
        (body (h1 "LambdaNative FastCGI")  
         "Request number " ,(number->string count)
          " running on host " (i ,(FCGI-getenv "SERVER_NAME"))
        )))
      )))
     (FCGI-Finish)
    ) (thread-sleep! 0.001))
  (loop))
Clone this wiki locally