Fixes and simplifications to HTTP example server:

The example HTTP server is updated to provide the correct MIME-type.
It no longer uses the now-deprecated http::stream class, since that
implementation does not provide flow control. A new example async_write
function is provided in the asynchronous server for managing the
lifetime of a message sent asynchronously.

The logging is thread-safe, and a bug causing connections to
malfunction is fixed.
This commit is contained in:
Vinnie Falco
2017-07-20 08:12:07 -07:00
parent 64206b5612
commit b42c928d5e
5 changed files with 315 additions and 98 deletions
+6 -1
View File
@@ -57,8 +57,13 @@ int main(int ac, char const* av[])
endpoint_type ep{address_type::from_string(ip), port};
if(sync)
{
http_sync_server server(ep, root);
beast::test::sig_wait();
}
else
{
http_async_server server(ep, threads, root);
beast::test::sig_wait();
beast::test::sig_wait();
}
}