| 2220 | } |
| 2221 | |
| 2222 | std::list<std::pair<std::string, uint32_t>> Server::GetSlaveHostAndPort() { |
| 2223 | std::list<std::pair<std::string, uint32_t>> result; |
| 2224 | { |
| 2225 | std::shared_lock<std::shared_mutex> guard(slave_threads_mu_); |
| 2226 | for (const auto &slave : slave_threads_) { |
| 2227 | if (slave->IsStopped()) continue; |
| 2228 | std::pair<std::string, int> host_port_pair = {slave->GetConn()->GetAnnounceIP(), |
| 2229 | slave->GetConn()->GetListeningPort()}; |
| 2230 | result.emplace_back(host_port_pair); |
| 2231 | } |
| 2232 | } |
| 2233 | return result; |
| 2234 | } |
| 2235 | |
| 2236 | // The numeric cursor consists of a 16-bit counter, a 16-bit time stamp, a 29-bit hash,and a 3-bit cursor type. The |
| 2237 | // hash is used to prevent information leakage. The time_stamp is used to prevent the generation of the same cursor in |
no test coverage detected