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

Method FlushOutputBuffers

library/cpp/neh/tcp2.cpp:1423–1444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1421 }
1422
1423 bool FlushOutputBuffers(bool asioThread) {
1424 DBGOUT("FlushOutputBuffers: cnt=" << OutputBuffers_.GetIOvec()->Count() << " c=" << (size_t)this);
1425 //TODO:reseach direct write efficiency
1426 if (asioThread || TTcp2Options::ServerUseDirectWrite) {
1427 TContIOVector& vec = *OutputBuffers_.GetIOvec();
1428
1429 vec.Proceed(AS_->WriteSome(vec));
1430
1431 if (vec.Complete()) {
1432 OutputBuffers_.Clear();
1433 //DBGOUT("WriteResponse: " << " c=" << (size_t)this);
1434 return true;
1435 }
1436 }
1437
1438 //socket buffer filled - use async write for sending left data
1439 DBGOUT("AsyncWriteResponse: "
1440 << " [" << OutputBuffers_.GetIOvec()->Bytes() << "]"
1441 << " c=" << (size_t)this);
1442 AS_->AsyncWrite(OutputBuffers_.GetIOvec(), std::bind(&TConnection::OnSend, TConnectionRef(this), _1, _2, _3), TTcp2Options::ServerOutputDeadline);
1443 return false;
1444 }
1445
1446 void OnFinishRequest(TRequestId reqId) {
1447 if (Y_LIKELY(!Canceled_)) {

Callers

nothing calls this directly

Calls 8

CompleteMethod · 0.80
BytesMethod · 0.80
CountMethod · 0.45
GetIOvecMethod · 0.45
ProceedMethod · 0.45
WriteSomeMethod · 0.45
ClearMethod · 0.45
AsyncWriteMethod · 0.45

Tested by

no test coverage detected