#include "music.h" #include "decoder.h" #include "encoder.h" #include "httpd.h" #include #include #include int main(int argc, char **argv) { try { music::init(argv[1]); decoder::init(); encoder::init(); boost::asio::io_service io_service; HTTPServer httpd(io_service, tcp::endpoint(tcp::v6(), 8000)); std::vector > threads; for(std::size_t i = 0; i < 10; i++) { boost::shared_ptr thread(new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service))); threads.push_back(thread); } for(std::size_t i = 0; i < 10; i++) { threads[i]->join(); } } catch(std::exception& e) { std::cerr << e.what() << std::endl; } return 0; }