synchronous write to a socket when writing a response to a socket. Ick.
Features this version offers: 1. Uses asynchronous reading and writing to/from sockets all the time. 2. Performs sectioned reads from on-disk files, allowing for serving files of
unlimited size.
For most people, one can run this from the command line and get a reasonably functioning web server with minor issue.
I benchmarked this version in my personal projects folder, which contains around a gig of files, sizes ranging from a few kilobytes, to 100 megabytes. I then performed two concurrent “wget -m http://localhost/” calls (from different paths) on Windows 2k (machine is a P4 2.8ghz with hyperthreading, 1.5 gigs memory, reading from an 80 gig SATA drive, writing to a 120 gig PATA drive).
On small files, it was able to serve up 15-30 files/second. On larger (10+ meg) files, it was able to serve up at 15+ megs/second (so says adding the speed reported by wget). The server never broke 7 megs of resident memory, and tended to hang below 10% processor utilization.
There exists a live host running this web server: nada.ics.uci.edu
Bases: HardwareObjects.AsyncHttpServer.RequestHandler
Bases: HardwareObjects.AsyncHttpServer.RequestHandler
Bases: dict
Bases: asynchat.async_chat, BaseHTTPServer.BaseHTTPRequestHandler
alias of ParseHeaders
Collect the data arriving on the connexion
Begins serving a GET request
Begins serving a POST request. The request data must be readable on a file-like object called self.rfile
Send the blank line ending the MIME headers, send the buffered response and headers on the connection
Class to override
Called when a POST request body has been read
Called when the http request line and headers have been received
Prepare to read the request body
Bases: asyncore.dispatcher