Examples |
00001 #include "connection_manager.hpp" 00002 #include <algorithm> 00003 #include <boost/bind.hpp> 00004 00005 namespace http { 00006 namespace server { 00007 00008 void connection_manager::start(connection_ptr c) 00009 { 00010 connections_.insert(c); 00011 c->start(); 00012 } 00013 00014 void connection_manager::stop(connection_ptr c) 00015 { 00016 connections_.erase(c); 00017 c->stop(); 00018 } 00019 00020 void connection_manager::stop_all() 00021 { 00022 std::for_each(connections_.begin(), connections_.end(), 00023 boost::bind(&connection::stop, _1)); 00024 connections_.clear(); 00025 } 00026 00027 } // namespace server 00028 } // namespace http