mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
Flush the output stream in the example
This commit is contained in:
@@ -6,6 +6,7 @@ Version 61:
|
|||||||
* Tidy up some integer conversion warnings
|
* Tidy up some integer conversion warnings
|
||||||
* Add message::header_part()
|
* Add message::header_part()
|
||||||
* Tidy up names in error categories
|
* Tidy up names in error categories
|
||||||
|
* Flush the output stream in the example
|
||||||
|
|
||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
|
@@ -22,11 +22,11 @@ int main()
|
|||||||
namespace ssl = boost::asio::ssl;
|
namespace ssl = boost::asio::ssl;
|
||||||
|
|
||||||
// Normal boost::asio setup
|
// Normal boost::asio setup
|
||||||
std::string const host = "github.com";
|
std::string const host = "localhost";
|
||||||
io_service ios;
|
io_service ios;
|
||||||
resolver r{ios};
|
resolver r{ios};
|
||||||
socket sock{ios};
|
socket sock{ios};
|
||||||
connect(sock, r.resolve(resolver::query{host, "https"}));
|
connect(sock, r.resolve(resolver::query{host, "1007"}));
|
||||||
|
|
||||||
// Perform SSL handshaking
|
// Perform SSL handshaking
|
||||||
ssl::context ctx{ssl::context::sslv23};
|
ssl::context ctx{ssl::context::sslv23};
|
||||||
@@ -56,4 +56,7 @@ int main()
|
|||||||
stream.shutdown(ec);
|
stream.shutdown(ec);
|
||||||
if(ec && ec != boost::asio::error::eof)
|
if(ec && ec != boost::asio::error::eof)
|
||||||
std::cout << "error: " << ec.message();
|
std::cout << "error: " << ec.message();
|
||||||
|
|
||||||
|
// Make sure everything is written before we leave main
|
||||||
|
std::cout.flush();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user