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

Method ResolveAddr

util/network/sock.h:104–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 int ResolveAddr() const {
105 if (in.sin_port == 0) {
106 int ret = 0;
107 // 1. open file
108 TFileHandle f(Path, OpenExisting | RdOnly);
109 if (!f.IsOpen()) {
110 return -errno;
111 }
112
113 // 2. read the port from file
114 ret = f.Read(&in.sin_port, sizeof(in.sin_port));
115 if (ret != sizeof(in.sin_port)) {
116 return -(errno ? errno : EFAULT);
117 }
118 }
119
120 return 0;
121 }
122
123 int Bind(SOCKET s, ui16 mode) const {
124 Y_UNUSED(mode);

Callers

nothing calls this directly

Calls 2

IsOpenMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected