11 #ifndef HTTP_SERVER2_IO_SERVICE_POOL_HPP 12 #define HTTP_SERVER2_IO_SERVICE_POOL_HPP 16 #include <boost/noncopyable.hpp> 17 #include <boost/shared_ptr.hpp> 24 :
private boost::noncopyable
40 typedef boost::shared_ptr<asio::io_service> io_service_ptr;
41 typedef boost::shared_ptr<asio::io_service::work> work_ptr;
44 std::vector<io_service_ptr> io_services_;
47 std::vector<work_ptr> work_;
50 std::size_t next_io_service_;
56 #endif // HTTP_SERVER2_IO_SERVICE_POOL_HPP Provides core I/O functionality.
void run()
Run all io_service objects in the pool.
A pool of io_service objects.
asio::io_service & get_io_service()
Get an io_service to use.
void stop()
Stop all io_service objects in the pool.
io_service_pool(std::size_t pool_size)
Construct the io_service pool.