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

Method CheckHealth

src/brpc/channel.cpp:646–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646int Channel::CheckHealth() {
647 if (_lb == NULL) {
648 SocketUniquePtr ptr;
649 if (Socket::Address(_server_id, &ptr) == 0 && ptr->IsAvailable()) {
650 return 0;
651 }
652 return -1;
653 } else {
654 SocketUniquePtr tmp_sock;
655 LoadBalancer::SelectIn sel_in = { 0, false, true, 0, NULL };
656 LoadBalancer::SelectOut sel_out(&tmp_sock);
657 return _lb->SelectServer(sel_in, &sel_out);
658 }
659}
660
661} // namespace brpc

Callers

nothing calls this directly

Calls 2

IsAvailableMethod · 0.80
SelectServerMethod · 0.45

Tested by

no test coverage detected