MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / poll

Method poll

Libraries/HttpClient/HttpClient.cpp:1562–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1560}
1561
1562SC::Result SC::HttpClientOperation::poll(uint32_t timeoutMilliseconds)
1563{
1564 SC_TRY_MSG(initialized, "HttpClientOperation: not initialized");
1565
1566 SC_TRY(processPendingEvents());
1567 if (timeoutMilliseconds == 0 or not requestInFlight)
1568 {
1569 return Result(true);
1570 }
1571
1572 eventMutex.lock();
1573 while (requestInFlight and eventCount == 0)
1574 {
1575 if (not eventCV.wait(eventMutex, timeoutMilliseconds))
1576 {
1577 eventMutex.unlock();
1578 return Result(true);
1579 }
1580 }
1581 eventMutex.unlock();
1582
1583 return processPendingEvents();
1584}
1585
1586void SC::HttpClientOperation::resetResponseState(HttpClientResponse& response)
1587{

Callers 7

cancelRequestMethod · 0.80
pollGetMethod · 0.80
pollConcurrentGetsMethod · 0.80
executeBlockingMethod · 0.80
pollReadyMethod · 0.80
pollAllMethod · 0.80
onWakeUpMethod · 0.80

Calls 4

ResultClass · 0.50
lockMethod · 0.45
waitMethod · 0.45
unlockMethod · 0.45

Tested by 3

cancelRequestMethod · 0.64
pollGetMethod · 0.64
pollConcurrentGetsMethod · 0.64