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

Method MyAddressInfo

src/butil/endpoint.cpp:244–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 IPStr my_ip_str;
243
244 MyAddressInfo() {
245 my_ip = IP_ANY;
246 if (gethostname(my_hostname, sizeof(my_hostname)) < 0) {
247 my_hostname[0] = '\0';
248 } else if (hostname2ip(my_hostname, &my_ip) != 0) {
249 my_ip = IP_ANY;
250 }
251 my_ip_str = ip2str(my_ip);
252 }
253};
254
255ip_t my_ip() {

Callers

nothing calls this directly

Calls 2

hostname2ipFunction · 0.85
ip2strFunction · 0.85

Tested by

no test coverage detected