MCPcopy Create free account
hub / github.com/COVESA/vsomeip / async_send

Method async_send

implementation/endpoints/src/local_socket_uds_impl.cpp:91–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void local_socket_uds_impl::async_send(std::vector<uint8_t> _data, write_handler _w_handle) {
92 std::unique_lock lock{socket_mtx_};
93 if (socket_->is_open()) {
94 // ensure the memory is kept alive as long as the callback hasn't been invoked
95 auto buffer = boost::asio::buffer(_data);
96 socket_->async_write(buffer, [d = std::move(_data), handler = std::move(_w_handle)](auto const& _ec, size_t _bytes) mutable {
97 handler(_ec, _bytes, std::move(d));
98 });
99 } else {
100 boost::asio::post(io_context_,
101 [h = std::move(_w_handle), d = std::move(_data)]() mutable { h(boost::asio::error::fault, 0, std::move(d)); });
102 }
103}
104
105std::string const& local_socket_uds_impl::to_string() const {
106 return name_;

Callers 5

send_queuedMethod · 0.45
send_buffer_unlockMethod · 0.45
send_ifa_requestMethod · 0.45
send_ifi_requestMethod · 0.45
send_rt_requestMethod · 0.45

Calls 3

bufferClass · 0.85
is_openMethod · 0.45
async_writeMethod · 0.45

Tested by

no test coverage detected