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

Method Port

util/network/endpoint.cpp:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35ui16 TEndpoint::Port() const noexcept {
36 if (Addr_->Addr()->sa_family == AF_UNIX) {
37 return 0;
38 }
39
40 const sockaddr* sa = Addr_->Addr();
41
42 if (sa->sa_family == AF_INET) {
43 return InetToHost(((const sockaddr_in*)sa)->sin_port);
44 } else {
45 return InetToHost(((const sockaddr_in6*)sa)->sin6_port);
46 }
47}
48
49size_t TEndpoint::Hash() const {
50 const sockaddr* sa = Addr_->Addr();

Callers 5

THttpServerMethod · 0.45
GetSendAddrFunction · 0.45
operator==Function · 0.45
Y_UNIT_TESTFunction · 0.45
PrintAddrFunction · 0.45

Calls 2

InetToHostFunction · 0.85
AddrMethod · 0.45

Tested by

no test coverage detected