MCPcopy Create free account
hub / github.com/catboost/catboost / TImpl

Method TImpl

util/network/socket.cpp:1009–1038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007
1008public:
1009 inline TImpl(const char* host, ui16 port, int flags)
1010 : Info_(nullptr, TAddrInfoDeleter{})
1011 {
1012 const TString port_st(ToString(port));
1013 struct addrinfo hints;
1014
1015 memset(&hints, 0, sizeof(hints));
1016
1017 hints.ai_flags = flags;
1018 hints.ai_family = PF_UNSPEC;
1019 hints.ai_socktype = SOCK_STREAM;
1020
1021 if (!host) {
1022 hints.ai_flags |= AI_PASSIVE;
1023 } else {
1024 if (!Singleton<TLocalNames>()->IsLocalName(host)) {
1025 hints.ai_flags |= AI_ADDRCONFIG;
1026 }
1027 }
1028
1029 struct addrinfo* pai = NULL;
1030 const int error = getaddrinfo(host, port_st.data(), &hints, &pai);
1031
1032 if (error) {
1033 TAddrInfoDeleter()(pai);
1034 ythrow TNetworkResolutionError(error) << ": can not resolve " << host << ":" << port;
1035 }
1036
1037 Info_.reset(pai);
1038 }
1039
1040 inline TImpl(const char* path, int flags)
1041 : Info_(nullptr, TAddrInfoDeleter{/* useFreeAddrInfo = */ false})

Callers

nothing calls this directly

Calls 10

TAddrInfoDeleterClass · 0.85
strcpyFunction · 0.85
IsLocalNameMethod · 0.80
ToStringFunction · 0.50
mallocFunction · 0.50
dataMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
ReleaseMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected