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

Method handle_receive

example/cpp11/tutorial/daytime6/server.cpp:47–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 }
46
47 void handle_receive(const boost::system::error_code& error,
48 std::size_t /*bytes_transferred*/)
49 {
50 if (!error)
51 {
52 std::shared_ptr<std::string> message(
53 new std::string(make_daytime_string()));
54
55 socket_.async_send_to(boost::asio::buffer(*message), remote_endpoint_,
56 std::bind(&udp_server::handle_send, this, message,
57 boost::asio::placeholders::error,
58 boost::asio::placeholders::bytes_transferred));
59
60 start_receive();
61 }
62 }
63
64 void handle_send(std::shared_ptr<std::string> /*message*/,
65 const boost::system::error_code& /*error*/,

Callers

nothing calls this directly

Calls 4

bufferFunction · 0.85
make_daytime_stringFunction · 0.70
bindFunction · 0.50
async_send_toMethod · 0.45

Tested by

no test coverage detected