From fe17a20f84a1bbbda893e775408b1c8ed28a6bc9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 7 Mar 2015 00:39:35 +0900 Subject: [PATCH] Update README.rst --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ee247ef2..9f480090 100644 --- a/README.rst +++ b/README.rst @@ -1041,6 +1041,7 @@ HTTP/2 server looks like this: using namespace nghttp2::asio_http2::server; int main(int argc, char *argv[]) { + boost::system::error_code ec; http2 server; server.handle("/", [](const request &req, const response &res) { @@ -1048,7 +1049,9 @@ HTTP/2 server looks like this: res.end("hello, world\n"); }); - server.listen_and_serve("*", 3000); + if (server.listen_and_serve(ec, "localhost", "3000")) { + std::cerr << "error: " << ec.message() << std::endl; + } } For more details, see the documentation of libnghttp2_asio.