Today’s theory: red/black trees, and more precisely the left leaning ones, as explained in these slides from the Princeton University. Many thanks to them for these excellent slides :)
See the RBTree class on github.
Today’s theory: red/black trees, and more precisely the left leaning ones, as explained in these slides from the Princeton University. Many thanks to them for these excellent slides :)
See the RBTree class on github.
Yep, the day is over. It’s time for me to stop working on the “One Day Server” (cfr. previous post). The project is an HTTP server running on UNIX environments, developed in C. See the sources on github.
So… What has been done ?
An asynchronous server base, primarily intended to serve static files over HTTP. The server is based on epoll(7), and therefore currently available for Linux only. But there is a wrapper around the epoll system, so it shouldn’t be too hard to port to other platforms.
An abstraction around the epoll() mechanism, as explained above. It should be easily portable to other systems as well. Have a look at it :)
An incremental HTTP parser that you can feed as you get the data from your client. It will parse the request as it comes, making information available as soon as possible.
Yes, but…
Ok, it’s not really functional yet. First, it doesn’t give you back the files, but only a text summary of you request…
1 2 3 4 5 6 7 8 9 10 | |
Also, the HTTP request parser is not complete yet, and the system as a whole probably has some memory leaks and security issues… But OK, it’s a one-day dev :P And I’m not that far from a working system.
Now what ?
Well I probably won’t have time to further develop this server in the next few weeks. But who knows, I might resume development after that :) I’ll keep you posted ! Thanks for following me :)
Hey, today I’m writing a HTTP server in just one day, with what I’ve learned lately about UNIX development. Follow me here on the github repository for the project.
I’ll keep you posted at the end of the day on this very blog about the result :) Cheers!
On my way to learn *nix stuff, I just wrote a little example on how to use semaphores in a UNIX environment.
Hope you’ll find this interesting, feel free to comment or reuse :)
In a race to learning UNIX systems programming, I just started building the TUUP: Totally Useless Unix Program.
Well really, it’s useless, unless you want to see random *NIX system calls here and there. If you’re at all interested, you can find the sources in the TUUP github repository.