| | |
| | | const auto topic{tmp_msg.c_str()}; |
| | | string msg{}; |
| | | { |
| | | lock_guard<mutex> l{(*sub)()}; |
| | | lock_guard<mutex> l{sub->operator()()}; |
| | | for(auto && i : sub->topics_){ |
| | | if (!!!i.compare(topic)){ |
| | | msg = move(tmp_msg.substr(i.size()+1)); |
| | |
| | | lock_guard<mutex> l{sub->mtx_failed_topics_}; |
| | | if (!sub->failed_topics_.empty()){ |
| | | for(auto iter = sub->failed_topics_.begin(); iter != sub->failed_topics_.end();){ |
| | | if (nn_setsockopt(sub->socket_, NN_SUB, NN_SUB_UNSUBSCRIBE, iter->c_str(), iter->length()) >= 0){ |
| | | if (nn_setsockopt(sub->socket_, NN_SUB, NN_SUB_SUBSCRIBE, iter->c_str(), iter->length()) >= 0){ |
| | | iter = sub->failed_topics_.erase(iter); |
| | | }else{ |
| | | iter++; |