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

Method handle_connect

example/cpp11/serialization/client.cpp:41–59  ·  view source on GitHub ↗

Handle completion of a connect operation.

Source from the content-addressed store, hash-verified

39
40 /// Handle completion of a connect operation.
41 void handle_connect(const boost::system::error_code& e)
42 {
43 if (!e)
44 {
45 // Successfully established connection. Start operation to read the list
46 // of stocks. The connection::async_read() function will automatically
47 // decode the data that is read from the underlying socket.
48 connection_.async_read(stocks_,
49 std::bind(&client::handle_read, this,
50 boost::asio::placeholders::error));
51 }
52 else
53 {
54 // An error occurred. Log it and return. Since we are not starting a new
55 // operation the io_context will run out of work to do and the client will
56 // exit.
57 std::cerr << e.message() << std::endl;
58 }
59 }
60
61 /// Handle completion of a read operation.
62 void handle_read(const boost::system::error_code& e)

Callers

nothing calls this directly

Calls 2

bindFunction · 0.50
async_readMethod · 0.45

Tested by

no test coverage detected