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

Method receive

example/cpp11/timeouts/blocking_udp_client.cpp:55–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 std::size_t receive(const boost::asio::mutable_buffer& buffer,
56 std::chrono::steady_clock::duration timeout,
57 boost::system::error_code& error)
58 {
59 // Start the asynchronous operation. The handle_receive function used as a
60 // callback will update the error and length variables.
61 std::size_t length = 0;
62 socket_.async_receive(boost::asio::buffer(buffer),
63 std::bind(&client::handle_receive, _1, _2, &error, &length));
64
65 // Run the operation until it completes, or until the timeout.
66 run(timeout);
67
68 return length;
69 }
70
71private:
72 void run(std::chrono::steady_clock::duration timeout)

Callers 1

mainFunction · 0.45

Calls 3

bufferFunction · 0.85
bindFunction · 0.50
async_receiveMethod · 0.45

Tested by

no test coverage detected