| 1263 | } |
| 1264 | |
| 1265 | void endpoint_manager_impl::drop_from(const boost::asio::ip::address& _address) { |
| 1266 | std::scoped_lock const its_endpoint_lock{routing_endpoint_mtx_}; |
| 1267 | for (auto const& [client, ep] : routing_endpoints_) { |
| 1268 | bool const drop = _address == ep->peer_endpoint().address(); |
| 1269 | if (drop) { |
| 1270 | VSOMEIP_INFO_P << "dropping connection for client: " << hex4(client) << ", " << ep->name(); |
| 1271 | // this is technically not correct, but it should be good enough for now. |
| 1272 | ep->trigger_error(); // ensure that we do all the clean-up |
| 1273 | } |
| 1274 | } |
| 1275 | // important to have the lock still acquired, because the endpoints error handler |
| 1276 | // might try to remove something and the pending endpoint should not be promoted due to this. |
| 1277 | for (auto itr = pending_routing_endpoints_.begin(); itr != pending_routing_endpoints_.end();) { |
| 1278 | client_t client = itr->first; |
| 1279 | std::shared_ptr<local_endpoint>& ep = itr->second; |
| 1280 | bool const drop = ep->peer_endpoint().address() == _address; |
| 1281 | |
| 1282 | if (drop) { |
| 1283 | VSOMEIP_INFO_P << "dropping pending connection for client " << hex4(client) << ", " << ep->name(); |
| 1284 | // immediate, data loss is OK |
| 1285 | ep->stop(true); |
| 1286 | itr = pending_routing_endpoints_.erase(itr); |
| 1287 | } else { |
| 1288 | ++itr; |
| 1289 | } |
| 1290 | } |
| 1291 | } |
| 1292 | |
| 1293 | void endpoint_manager_impl::add_local_routing_endpoint(std::shared_ptr<local_endpoint> _ep) { |
| 1294 | auto const client = _ep->connected_client(); |
no test coverage detected