Rooster is a simple server built in Chicken Scheme. It requires epoll at the moment.
Scheme
Switch branches/tags
Nothing to show
Latest commit e3f3339 Nov 27, 2010 @davidreynolds amended comment

README

Rooster is a server built in Chicken Scheme.
Rooster makes use of the epoll egg that I wrote (http://github.com/davidreynolds/epoll) to handle socket events.

Right now I'm working on making Rooster into a web server. Don't expect too much right now.

Requires linux + epoll at the moment.
I'd like to fallback to poll if epoll isn't available.

Run make to generate rooster.so

    $ make

To use rooster.so for a basic web server:

    (require 'rooster)

    (define (handler fd buf)
        (let* ((msg "Hello, world")
               (headers (format
                            "HTTP/1.1 200 OK\r\nContent-Length:~A\r\n\r\n"
                            (string-length msg))))
            (send-to-client fd (string-append headers msg))))

    ;; pass handler to rooster
    (run-rooster handler)

To run the examples, make rooster and then do:

    $ csi examples/webserver/webserver.scm

You'll then be dropped into the Chicken Scheme Interpreter and from another shell prompt
you can

    $ curl localhost:6666