diff --git a/examples/asio-sv.cc b/examples/asio-sv.cc index 6fc320c4..bba048fa 100644 --- a/examples/asio-sv.cc +++ b/examples/asio-sv.cc @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) { res.end("finally!\n"); }); }); - server.listen("*", port); + server.listen_and_serve("*", port); } catch (std::exception &e) { std::cerr << "exception: " << e.what() << "\n"; diff --git a/examples/asio-sv2.cc b/examples/asio-sv2.cc index 63eb1800..a756e9e0 100644 --- a/examples/asio-sv2.cc +++ b/examples/asio-sv2.cc @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) { res.end(file_generator_from_fd(fd)); }); - server.listen("*", port); + server.listen_and_serve("*", port); } catch (std::exception &e) { std::cerr << "exception: " << e.what() << "\n"; diff --git a/src/asio_server_http2_impl.cc b/src/asio_server_http2_impl.cc index 6e00b507..5567cc5a 100644 --- a/src/asio_server_http2_impl.cc +++ b/src/asio_server_http2_impl.cc @@ -41,8 +41,8 @@ http2::http2() : impl_(make_unique()) {} http2::~http2() {} -void http2::listen(const std::string &address, uint16_t port) { - impl_->listen(address, port); +void http2::listen_and_serve(const std::string &address, uint16_t port) { + impl_->listen_and_serve(address, port); } void http2::num_threads(size_t num_threads) { impl_->num_threads(num_threads); } @@ -66,7 +66,7 @@ std::vector &get_alpn_token() { } } // namespace -void http2_impl::listen(const std::string &address, uint16_t port) { +void http2_impl::listen_and_serve(const std::string &address, uint16_t port) { std::unique_ptr ssl_ctx; if (!private_key_file_.empty() && !certificate_file_.empty()) { diff --git a/src/asio_server_http2_impl.h b/src/asio_server_http2_impl.h index 5c5494a5..d2f373e3 100644 --- a/src/asio_server_http2_impl.h +++ b/src/asio_server_http2_impl.h @@ -42,7 +42,7 @@ class server; class http2_impl { public: http2_impl(); - void listen(const std::string &address, uint16_t port); + void listen_and_serve(const std::string &address, uint16_t port); void num_threads(size_t num_threads); void tls(std::string private_key_file, std::string certificate_file); void backlog(int backlog); diff --git a/src/includes/nghttp2/asio_http2_server.h b/src/includes/nghttp2/asio_http2_server.h index a3df3310..12ac871c 100644 --- a/src/includes/nghttp2/asio_http2_server.h +++ b/src/includes/nghttp2/asio_http2_server.h @@ -128,7 +128,7 @@ public: // Starts listening connection on given address and port and serves // incoming requests. - void listen(const std::string &address, uint16_t port); + void listen_and_serve(const std::string &address, uint16_t port); // Registers request handler |cb| with path pattern |pattern|. This // function will fail and returns false if same pattern has been