MCPcopy Create free account
hub / github.com/SmingHub/Sming / cleanInactive

Method cleanInactive

Sming/Components/Network/src/Network/Http/HttpClient.cpp:67–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void HttpClient::cleanInactive()
68{
69 debug_d("Total connections: %d", httpConnectionPool.count());
70
71 size_t i = 0;
72 while(i < httpConnectionPool.count()) {
73 auto connection = httpConnectionPool.valueAt(i);
74
75 if(connection->getConnectionState() > eTCS_Connecting && !connection->isActive()) {
76 debug_d("Removing stale connection: State: %d, Active: %d, Finished: %d", connection->getConnectionState(),
77 connection->isActive(), connection->isFinished());
78 httpConnectionPool.removeAt(i);
79 } else {
80 ++i;
81 }
82 }
83}

Callers

nothing calls this directly

Calls 6

valueAtMethod · 0.80
getConnectionStateMethod · 0.80
isActiveMethod · 0.80
countMethod · 0.45
isFinishedMethod · 0.45
removeAtMethod · 0.45

Tested by

no test coverage detected