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
2016-06-20 10:48:53 -04:00
parent bbad20c66f
commit 5c7130e4fd
5 changed files with 315 additions and 98 deletions

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();
}
}