Merge branch 'master' of https://github.com/apohl79/nghttp2 into apohl79-master

This commit is contained in:
Tatsuhiro Tsujikawa 2015-12-10 21:09:28 +09:00
commit 66bbb5c76f
8 changed files with 26 additions and 0 deletions

View File

@ -92,6 +92,10 @@ boost::asio::io_service &io_service_pool::get_io_service() {
return io_service; return io_service;
} }
const std::vector<std::shared_ptr<boost::asio::io_service>> &io_service_pool::get_io_services() const {
return io_services_;
}
} // namespace asio_http2 } // namespace asio_http2
} // namespace nghttp2 } // namespace nghttp2

View File

@ -70,6 +70,9 @@ public:
/// Get an io_service to use. /// Get an io_service to use.
boost::asio::io_service &get_io_service(); boost::asio::io_service &get_io_service();
/// Get access to all io_service objects.
const std::vector<std::shared_ptr<boost::asio::io_service>> &get_io_services() const;
private: private:
/// The pool of io_services. /// The pool of io_services.
std::vector<std::shared_ptr<boost::asio::io_service>> io_services_; std::vector<std::shared_ptr<boost::asio::io_service>> io_services_;

View File

@ -169,6 +169,10 @@ void server::stop() { io_service_pool_.stop(); }
void server::join() { io_service_pool_.join(); } void server::join() { io_service_pool_.join(); }
const std::vector<std::shared_ptr<boost::asio::io_service>> &server::get_io_services() const {
return io_service_pool_.get_io_services();
}
} // namespace server } // namespace server
} // namespace asio_http2 } // namespace asio_http2
} // namespace nghttp2 } // namespace nghttp2

View File

@ -73,6 +73,9 @@ public:
void join(); void join();
void stop(); void stop();
/// Get access to all io_service objects.
const std::vector<std::shared_ptr<boost::asio::io_service>> &get_io_services() const;
private: private:
/// Initiate an asynchronous accept operation. /// Initiate an asynchronous accept operation.
void start_accept(tcp::acceptor &acceptor, serve_mux &mux); void start_accept(tcp::acceptor &acceptor, serve_mux &mux);

View File

@ -77,6 +77,10 @@ void http2::stop() { impl_->stop(); }
void http2::join() { return impl_->join(); } void http2::join() { return impl_->join(); }
const std::vector<std::shared_ptr<boost::asio::io_service>> &http2::get_io_services() const {
return impl_->get_io_services();
}
} // namespace server } // namespace server
} // namespace asio_http2 } // namespace asio_http2

View File

@ -59,6 +59,10 @@ void http2_impl::stop() { return server_->stop(); }
void http2_impl::join() { return server_->join(); } void http2_impl::join() { return server_->join(); }
const std::vector<std::shared_ptr<boost::asio::io_service>> &http2_impl::get_io_services() const {
return server_->get_io_services();
}
} // namespace server } // namespace server
} // namespace asio_http2 } // namespace asio_http2

View File

@ -50,6 +50,7 @@ public:
bool handle(std::string pattern, request_cb cb); bool handle(std::string pattern, request_cb cb);
void stop(); void stop();
void join(); void join();
const std::vector<std::shared_ptr<boost::asio::io_service>> &get_io_services() const;
private: private:
std::unique_ptr<server> server_; std::unique_ptr<server> server_;

View File

@ -201,6 +201,9 @@ public:
// Join on http2 server and wait for it to fully stop // Join on http2 server and wait for it to fully stop
void join(); void join();
// Get access to the io_service objects.
const std::vector<std::shared_ptr<boost::asio::io_service>> &get_io_services() const;
private: private:
std::unique_ptr<http2_impl> impl_; std::unique_ptr<http2_impl> impl_;
}; };