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

Method WaitUntilWritten

library/cpp/neh/https.cpp:838–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836 }
837
838 void WaitUntilWritten() {
839#if defined(FIONWRITE)
840 if (Y_LIKELY(Cont_)) {
841 int err;
842 int nbytes = Max<int>();
843 TDuration tout = TDuration::MilliSeconds(10);
844
845 while (((err = ioctl(S_, FIONWRITE, &nbytes)) == 0) && nbytes) {
846 err = NCoro::PollT(Cont_, S_, CONT_POLL_READ, tout);
847
848 if (!err) {
849 //wait complete, cause have some data
850 break;
851 }
852
853 if (err != ETIMEDOUT) {
854 ythrow TSystemError(err) << TStringBuf("request failed");
855 }
856
857 tout = tout * 2;
858 }
859
860 if (err) {
861 ythrow TSystemError() << TStringBuf("ioctl() failed");
862 }
863 } else {
864 ythrow TSslException() << TStringBuf("No cont available");
865 }
866#endif
867 }
868
869 void AcquireCont(TCont* c) {
870 Cont_ = c;

Callers 2

WaitUntilWrittenMethod · 0.45
ProcessRecvMethod · 0.45

Calls 2

MilliSecondsFunction · 0.85
PollTFunction · 0.85

Tested by

no test coverage detected