Update README.rst

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-07 00:39:35 +09:00
parent 773b108eeb
commit fe17a20f84
1 changed files with 4 additions and 1 deletions

View File

@ -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.