I worked on the HTTPD. Well, what is supposed to become a HTTPD. I at least managed to get it to the point where it correctly connects itself to port 8080 and accepts connections. It immediately closes them. But that was my very first target to be reached. Quite a lot of infrastructure is in place already. E.g. the complete poll loop is already working.
The next two steps are to add some form of logging and making the existing code handle possible errors correctly. Currently I just added some asserts and that is it. I guess in a real server it is not really acceptable to just crash if something happens, like running out of sockets or similar things.
The other step to be made is to start on the HTTP-part. I will add three new classes, one will handle the HTTP-connection, one will be the HTTP-request (only GET for now) and one will be the response. Then I should be able to connect with a browser and see if I can get a web page served.
It seems as if writing a webserver isn't really so hard. I am a bit surprised, actually.
The other thing I have been doing for this project is, that I installed a fresh FreeBSD 6.1 to a test machine. It is an old box, only a Celeron 366MHz with 128MB of memory. It has a 100MBit network card. I also installed lighttpd. First thing I want to try is if lighty can saturate the network and how much power it needs. I know, the box is too weak, but it is a machine I can just reinstall when I want as I don't use it for anything else. The second thing I want to do is to install PHP 5 on it. And then write a simple PHP-page consisting only of an echo statement which creates the same page I intend to use to test lighty with. I am very curious about how much slower it is. Then I will also install xcache and do the same tests. And I want to see how my simple poll based implementation will compete with the static page.
I am really curious about the numbers.
Finally found some time to implement the timeouts in the HTTPD. Now I am only missing correct signaling of the connection handling stuff (basically the Connection: close when the maximum number of requests that will be served on one connection has been re
Tracked: Dec 30, 22:36