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

Method prepare_connect

implementation/endpoints/src/local_socket_uds_impl.cpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void local_socket_uds_impl::prepare_connect([[maybe_unused]] configuration const& _configuration, boost::system::error_code& _ec) {
55 std::scoped_lock const lock{socket_mtx_};
56 socket_->open(peer_endpoint_.protocol(), _ec);
57 if (_ec) {
58 if (_ec == boost::asio::error::already_open) {
59 // not that any error above will be treated as a failure, but this one isn't really
60 // --> reset
61 _ec = boost::system::error_code();
62 }
63 return;
64 }
65
66 boost::system::error_code ec;
67 socket_->set_reuse_address(ec);
68 if (ec) {
69 VSOMEIP_WARNING_P << "Could not setsockopt(SO_REUSEADDR), " << ec.message() << ", " << name_;
70 }
71}
72
73void local_socket_uds_impl::async_connect(connect_handler _handler) {
74 std::unique_lock lock{socket_mtx_};

Callers 1

connect_unlockMethod · 0.45

Calls 4

messageMethod · 0.80
openMethod · 0.45
protocolMethod · 0.45
set_reuse_addressMethod · 0.45

Tested by

no test coverage detected