MCPcopy Create free account
hub / github.com/LUX-Core/lux / waitClientClose

Method waitClientClose

src/httpserver.cpp:547–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547void HTTPRequest::waitClientClose() {
548 LogPrint("http-poll", "wait for connection close\n");
549
550 // wait at most 5 seconds for client to close
551 for (int i = 0; i < 10 && IsRPCRunning() && !isConnClosed(); i++) {
552 std::unique_lock<std::mutex> lock(cs);
553 closeCv.wait_for(lock, std::chrono::milliseconds(500));
554 }
555
556 if (isConnClosed()) {
557 LogPrint("http-poll", "wait for connection close, ok\n");
558 } else if (!IsRPCRunning()) {
559 LogPrint("http-poll", "wait for connection close, RPC stopped\n");
560 } else {
561 LogPrint("http-poll", "wait for connection close, timeout after 5 seconds\n");
562 }
563}
564
565void HTTPRequest::startDetectClientClose() {
566 LogPrint("http-poll", "start detect http connection close\n");

Callers

nothing calls this directly

Calls 3

LogPrintFunction · 0.85
IsRPCRunningFunction · 0.85
wait_forMethod · 0.45

Tested by

no test coverage detected