fix: update asio-sv.cc to use new callback
This commit is contained in:
parent
d7f98c48d1
commit
ff1b961c5b
|
@ -42,6 +42,13 @@
|
||||||
using namespace nghttp2::asio_http2;
|
using namespace nghttp2::asio_http2;
|
||||||
using namespace nghttp2::asio_http2::server;
|
using namespace nghttp2::asio_http2::server;
|
||||||
|
|
||||||
|
void all_threads_created_cb(
|
||||||
|
std::vector<std::shared_ptr<thread_info>> all_threads_info) {
|
||||||
|
for (auto thread_info : all_threads_info) {
|
||||||
|
std::cout << "thread pid: " << thread_info->pid << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
try {
|
try {
|
||||||
// Check command line arguments.
|
// Check command line arguments.
|
||||||
|
@ -62,6 +69,8 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
server.num_threads(num_threads);
|
server.num_threads(num_threads);
|
||||||
|
|
||||||
|
server.set_on_all_threads_created_callback(all_threads_created_cb);
|
||||||
|
|
||||||
server.handle("/", [](const request &req, const response &res) {
|
server.handle("/", [](const request &req, const response &res) {
|
||||||
res.write_head(200, {{"foo", {"bar"}}});
|
res.write_head(200, {{"foo", {"bar"}}});
|
||||||
res.end("hello, world\n");
|
res.end("hello, world\n");
|
||||||
|
|
Loading…
Reference in New Issue