News for hackers. Stuff that matters.
Re:Ask HN: Getting started in server programming by getsat on Sunday July 31, 2011 @06:05AM (#2828040)
Learn the differences between select/poll/epoll/kqueue. You don't want to waste time using select() when you're intending to handle lots of concurrent clients or use epoll/kqueue when you have a limited number of connections and care about throughput.

For simple servers, I use Ruby + EventMachine[0], but there's also C++ bindings for it.

Since I use Ruby, I'd simply use Mongrel[1] within my server to serve HTTP docs and all my Ruby data structures can be serialized into JSON by just including a json lib and calling #to_json. I'm sure there's similar embeddable HTTP servers and JSON libs for C++.

  require 'json'
  {:numbers => (1..10).to_a, :foo => 'bar'}.to_json
  => "{\"numbers\":[1,2,3,4,5,6,7,8,9,10],\"foo\":\"bar\"}"
[0] https://github.com/eventmachine/eventmachine/wiki

[1] http://en.wikipedia.org/wiki/Mongrel_(web_server)

There are no comments on this comment yet.