MCPcopy Create free account
hub / github.com/apache/brpc / ParseEndpoint

Function ParseEndpoint

test/brpc_redis_cluster_unittest.cpp:173–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173static bool ParseEndpoint(const std::string& endpoint, std::string* host, int* port) {
174 size_t pos = endpoint.rfind(':');
175 if (pos == std::string::npos) {
176 return false;
177 }
178 *host = endpoint.substr(0, pos);
179 *port = atoi(endpoint.substr(pos + 1).c_str());
180 return (*port > 0);
181}
182
183class AskingHandler : public brpc::RedisCommandHandler {
184public:

Callers 1

FillSlotEntryMethod · 0.85

Calls 3

rfindMethod · 0.80
substrMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected