| | |
| | | |
| | | bool SocketRequest::QueryRPCTopic(const std::string &topic, bhome::msg::BHAddress &addr, const int timeout_ms) |
| | | { |
| | | if (tmp_cache_.first == topic) { |
| | | addr = tmp_cache_.second; |
| | | if (topic_cache_.Find(topic, addr)) { |
| | | return true; |
| | | } |
| | | |
| | |
| | | DataProcQueryTopicReply reply; |
| | | if (reply.ParseFromString(result.body())) { |
| | | addr = reply.address(); |
| | | tmp_cache_.first = topic; |
| | | tmp_cache_.second = addr; |
| | | return !addr.mq_id().empty(); |
| | | if (addr.mq_id().empty()) { |
| | | return false; |
| | | } else { |
| | | topic_cache_.Update(topic, addr); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } else { |