A simple, extensible HTTP server in Cocoa(cocoawithlove.com)
cocoawithlove.com
A simple, extensible HTTP server in Cocoa
http://cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html
2 comments
Cocoa? Wouldn't that be like writing a HTTP server in Tk/Tcl?
That's pretty impressive.
not sure why you would think that! objective-c uses a dispatch method for message-passing which is a little slower than direct function calls, but it rarely slows things down in practice. even if it does, there are ways around it: for speed-critical code you can circumvent message-passing and call functions directly.
cocoa code ends up being compiled, after all. that makes it lots faster than the latest scripting languages.
cocoa code ends up being compiled, after all. that makes it lots faster than the latest scripting languages.
The harder part is maintaining session info between requests and garbage collecting dead sessions, though you could just authenticate each request.