MCPcopy Create free account
hub / github.com/boostorg/asio / client

Method client

example/cpp11/serialization/client.cpp:26–38  ·  view source on GitHub ↗

Constructor starts the asynchronous connect operation.

Source from the content-addressed store, hash-verified

24public:
25 /// Constructor starts the asynchronous connect operation.
26 client(boost::asio::io_context& io_context,
27 const std::string& host, const std::string& service)
28 : connection_(io_context.get_executor())
29 {
30 // Resolve the host name into a sequence of endpoints.
31 boost::asio::ip::tcp::resolver resolver(io_context);
32 auto endpoints = resolver.resolve(host, service);
33
34 // Start an asynchronous connect operation.
35 boost::asio::async_connect(connection_.socket(), endpoints,
36 std::bind(&client::handle_connect, this,
37 boost::asio::placeholders::error));
38 }
39
40 /// Handle completion of a connect operation.
41 void handle_connect(const boost::system::error_code& e)

Callers

nothing calls this directly

Calls 4

async_connectFunction · 0.50
bindFunction · 0.50
get_executorMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected