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

Method OnDescription

src/brpc/socket.cpp:928–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928std::string Socket::OnDescription() const {
929 // NOTE: The output of `description()' should be consistent with operator<<()
930 std::string result;
931 result.reserve(64);
932 const int saved_fd = fd();
933 if (saved_fd >= 0) {
934 butil::string_appendf(&result, "fd=%d ", saved_fd);
935 }
936 butil::string_appendf(&result, "addr=%s",
937 butil::endpoint2str(remote_side()).c_str());
938 const int local_port = local_side().port;
939 if (local_port > 0) {
940 butil::string_appendf(&result, ":%d", local_port);
941 }
942 return result;
943}
944
945void Socket::HoldHCRelatedRef() {
946 if (_health_check_interval_s > 0) {

Callers

nothing calls this directly

Calls 7

fdFunction · 0.85
string_appendfFunction · 0.85
endpoint2strFunction · 0.85
remote_sideFunction · 0.85
local_sideFunction · 0.85
reserveMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected