Commit 66bbb5c7 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

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

parents 86505b1c a4392d4a
...@@ -92,6 +92,10 @@ boost::asio::io_service &io_service_pool::get_io_service() { ...@@ -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
...@@ -70,6 +70,9 @@ public: ...@@ -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_;
......
...@@ -169,6 +169,10 @@ void server::stop() { io_service_pool_.stop(); } ...@@ -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
...@@ -73,6 +73,9 @@ public: ...@@ -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);
......
...@@ -77,6 +77,10 @@ void http2::stop() { impl_->stop(); } ...@@ -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
......
...@@ -59,6 +59,10 @@ void http2_impl::stop() { return server_->stop(); } ...@@ -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
......
...@@ -50,6 +50,7 @@ public: ...@@ -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_;
......
...@@ -201,6 +201,9 @@ public: ...@@ -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_;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment