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

Method SelectPacket

library/cpp/netliba/v12/net_acks.cpp:60–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 int TAckTracker::SelectPacket() {
61 if (!ResendQueue.empty()) {
62 int res = ResendQueue.back();
63 ResendQueue.pop_back();
64 if (AckReceived[res]) {
65 fprintf(stderr, "resending packet %d, but ack already received\n", res);
66 }
67 return res;
68 }
69 if (CurrentPacket == PacketCount) {
70 return -1;
71 }
72 return CurrentPacket++;
73 }
74
75 TAckTracker::~TAckTracker() {
76 for (TPacketHash::const_iterator i = PacketsInFly.begin(); i != PacketsInFly.end(); ++i)

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected