MCPcopy Create free account
hub / github.com/apache/thrift / getSocketInfo

Method getSocketInfo

lib/cpp/src/thrift/transport/TSocket.cpp:833–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833string TSocket::getSocketInfo() const {
834 std::ostringstream oss;
835 if (!isUnixDomainSocket()) {
836 if (host_.empty() || port_ == 0) {
837 oss << "<Host: " << getPeerAddress();
838 oss << " Port: " << getPeerPort() << ">";
839 } else {
840 oss << "<Host: " << host_ << " Port: " << port_ << ">";
841 }
842 } else {
843 std::string fmt_path_ = path_;
844 // Handle printing abstract sockets (first character is a '\0' char):
845 if (!fmt_path_.empty() && fmt_path_[0] == '\0')
846 fmt_path_[0] = '@';
847 oss << "<Path: " << fmt_path_ << ">";
848 }
849 return oss.str();
850}
851
852std::string TSocket::getPeerHost() const {
853 if (peerHost_.empty() && !isUnixDomainSocket()) {

Callers 2

getHandlerMethod · 0.80
workSocketMethod · 0.80

Calls 2

emptyMethod · 0.80
strMethod · 0.80

Tested by

no test coverage detected