You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCC/webcc/http_connection_pool.cc

31 lines
609 B
C++

#include "webcc/http_connection_pool.h"
#include "webcc/logger.h"
namespace webcc {
HttpConnectionPool::HttpConnectionPool() {
}
void HttpConnectionPool::Start(HttpConnectionPtr c) {
LOG_VERB("Starting connection...");
connections_.insert(c);
c->Start();
}
void HttpConnectionPool::Close(HttpConnectionPtr c) {
LOG_VERB("Closing connection...");
connections_.erase(c);
c->Close();
}
void HttpConnectionPool::CloseAll() {
LOG_VERB("Closing all (%u) connections...", connections_.size());
for (auto& c : connections_) {
c->Close();
}
connections_.clear();
}
} // namespace webcc