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

Function PollD

util/network/socket.cpp:1235–1256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233}
1234
1235ssize_t PollD(struct pollfd fds[], nfds_t nfds, const TInstant& deadLine) noexcept {
1236 TInstant now = TInstant::Now();
1237
1238 do {
1239 const TDuration toWait = PollStep(deadLine, now);
1240 const int res = poll(fds, nfds, MicroToMilli(toWait.MicroSeconds()));
1241
1242 if (res > 0) {
1243 return res;
1244 }
1245
1246 if (res < 0) {
1247 const int err = LastSystemError();
1248
1249 if (err != ETIMEDOUT && err != EINTR) {
1250 return -err;
1251 }
1252 }
1253 } while ((now = TInstant::Now()) < deadLine);
1254
1255 return -ETIMEDOUT;
1256}
1257
1258void ShutDown(SOCKET s, int mode) {
1259 if (shutdown(s, mode)) {

Callers 2

DoConnectImplFunction · 0.70
CommunicateMethod · 0.50

Calls 6

PollStepFunction · 0.85
MicroToMilliFunction · 0.85
LastSystemErrorFunction · 0.85
pollFunction · 0.70
NowFunction · 0.50
MicroSecondsMethod · 0.45

Tested by

no test coverage detected