缩减代码
This commit is contained in:
@@ -37,14 +37,6 @@ void WebSocket_Manager::add(const drogon::WebSocketConnectionPtr &conn) {
|
||||
std::lock_guard<std::mutex> g(mtx);
|
||||
connections.insert(conn);
|
||||
}
|
||||
void WebSocket_Manager::visit(
|
||||
const std::function<void(const drogon::WebSocketConnectionPtr &conn)>
|
||||
&func) {
|
||||
std::lock_guard<std::mutex> g(mtx);
|
||||
for (const auto &coon : connections) {
|
||||
func(coon);
|
||||
}
|
||||
}
|
||||
void WebSocket_Manager::push_data(const char *buf, uint64_t len) {
|
||||
std::lock_guard<std::mutex> g(mtx);
|
||||
for (const auto &conn : connections) {
|
||||
|
||||
Reference in New Issue
Block a user