cannot write to socket - Broken pipe added by mario-goulart on Sat Jun 2 00:24:55 2012

;;; Server part:

$ csi -e '(use spiffy) (start-server)'


;;; Client part:

$ cat client.scm
(use http-client)

(define (get path)
  (let ((val (handle-exceptions exn
               'ignore
               (with-input-from-request
                (string-append "http://localhost:8080" path)
                #f
                read-string))))
    (close-all-connections!)
    val))

(let loop ((i 0))
  (unless (= i 10000)
    (print i)
    (get "/foo")
    (loop (+ i 1))))

$ csi -s client.scm