| 94 | } |
| 95 | |
| 96 | void local_acceptor_uds_impl::async_accept(connection_handler _handler) { |
| 97 | std::scoped_lock const lock{mtx_}; |
| 98 | // tmp_socket is a `shared_ptr` due to the `std::function` below which requires everything to be copyable |
| 99 | std::shared_ptr<uds_socket> tmp_socket = abstract_socket_factory::get()->create_uds_socket(io_); |
| 100 | // Use the peer-endpoint overload so the remote address is captured by the kernel at accept() time. |
| 101 | // If the client disconnects immediately after connecting, calling remote_endpoint() on the socket |
| 102 | // in the callback would fail |
| 103 | auto tmp_remote_ep = std::make_shared<endpoint>(); |
| 104 | uds_socket& socket_ref = *tmp_socket; |
| 105 | acceptor_->async_accept(socket_ref, *tmp_remote_ep, |
| 106 | [weak_self = weak_from_this(), h = std::move(_handler), tmp_socket, tmp_remote_ep](auto const& _ec) { |
| 107 | if (auto self = weak_self.lock(); self) { |
| 108 | self->accept_cbk(_ec, std::move(h), tmp_socket, tmp_remote_ep); |
| 109 | } |
| 110 | }); |
| 111 | } |
| 112 | |
| 113 | port_t local_acceptor_uds_impl::get_local_port() { |
| 114 | return VSOMEIP_SEC_PORT_UNUSED; |
nothing calls this directly
no test coverage detected