| 285 | } |
| 286 | |
| 287 | void routing_manager_impl::erase_offer_command(service_t _service, instance_t _instance) { |
| 288 | auto found_service_instance = offer_commands_.find(std::make_pair(_service, _instance)); |
| 289 | if (found_service_instance != offer_commands_.end()) { |
| 290 | // erase processed command |
| 291 | if (!found_service_instance->second.empty()) { |
| 292 | found_service_instance->second.pop_front(); |
| 293 | if (!found_service_instance->second.empty()) { |
| 294 | // check for other commands to be processed |
| 295 | auto its_command = found_service_instance->second.front(); |
| 296 | if (std::get<0>(its_command) == uint8_t(protocol::id_e::OFFER_SERVICE_ID)) { |
| 297 | boost::asio::post(io_, [this, its_command, _service, _instance]() { |
| 298 | offer_service(std::get<1>(its_command), _service, _instance, std::get<2>(its_command), std::get<3>(its_command), |
| 299 | false); |
| 300 | }); |
| 301 | } else { |
| 302 | boost::asio::post(io_, [this, its_command, _service, _instance]() { |
| 303 | stop_offer_service(std::get<1>(its_command), _service, _instance, std::get<2>(its_command), |
| 304 | std::get<3>(its_command), false); |
| 305 | }); |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | bool routing_manager_impl::is_local_client(client_t _client) const { |
| 313 | return find_routing_endpoint(_client) != nullptr; |