forked from boostorg/beast
Update for Net-TS Asio (API Change):
fix #769 The following classes are removed: * handler_type * async_result * async_completion * is_dynamic_buffer * is_const_buffer_sequence * is_mutable_buffer_sequence * handler_alloc Actions Required: * Use BOOST_ASIO_HANDLER_TYPE instead of handler_type * Use BOOST_ASIO_INITFN_RESULT_TYPE instead of async_result * Use boost::asio::async_completion * Use boost::asio::is_dynamic_buffer * Use boost::asio::is_const_buffer_sequence * Use boost::asio::is_mutable_buffer_sequence * boost::asio::associated_allocator_t replaces handler_alloc
This commit is contained in:
@@ -47,8 +47,8 @@ int main(int argc, char** argv)
|
||||
auto const port = argv[2];
|
||||
auto const text = argv[3];
|
||||
|
||||
// The io_service is required for all I/O
|
||||
boost::asio::io_service ios;
|
||||
// The io_context is required for all I/O
|
||||
boost::asio::io_context ioc;
|
||||
|
||||
// The SSL context is required, and holds certificates
|
||||
ssl::context ctx{ssl::context::sslv23_client};
|
||||
@@ -57,14 +57,14 @@ int main(int argc, char** argv)
|
||||
load_root_certificates(ctx);
|
||||
|
||||
// These objects perform our I/O
|
||||
tcp::resolver resolver{ios};
|
||||
websocket::stream<ssl::stream<tcp::socket>> ws{ios, ctx};
|
||||
tcp::resolver resolver{ioc};
|
||||
websocket::stream<ssl::stream<tcp::socket>> ws{ioc, ctx};
|
||||
|
||||
// Look up the domain name
|
||||
auto const lookup = resolver.resolve({host, port});
|
||||
auto const results = resolver.resolve(host, port);
|
||||
|
||||
// Make the connection on the IP address we get from a lookup
|
||||
boost::asio::connect(ws.next_layer().next_layer(), lookup);
|
||||
boost::asio::connect(ws.next_layer().next_layer(), results.begin(), results.end());
|
||||
|
||||
// Perform the SSL handshake
|
||||
ws.next_layer().handshake(ssl::stream_base::client);
|
||||
|
||||
Reference in New Issue
Block a user