asio 0.3.8rc3 | Home | Reference | Tutorial | Examples | Design

Examples |

# http/server/connection_manager.cpp

Go to the documentation of this file.

    00001 //
    00002 // connection_manager.cpp
    00003 // ~~~~~~~~~~~~~~~~~~~~~~
    00004 //
    00005 // Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
    00006 //
    00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
    00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    00009 //
    00010
    00011 #include "connection_manager.hpp"
    00012 #include <algorithm>
    00013 #include <boost/bind.hpp>
    00014
    00015 namespace http {
    00016 namespace server {
    00017
    00018 void connection_manager::start(connection_ptr c)
    00019 {
    00020   connections_.insert(c);
    00021   c->start();
    00022 }
    00023
    00024 void connection_manager::stop(connection_ptr c)
    00025 {
    00026   connections_.erase(c);
    00027   c->stop();
    00028 }
    00029
    00030 void connection_manager::stop_all()
    00031 {
    00032   std::for_each(connections_.begin(), connections_.end(),
    00033       boost::bind(&connection::stop, _1));
    00034   connections_.clear();
    00035 }
    00036
    00037 } // namespace server
    00038 } // namespace http

asio 0.3.8rc3 | Home | Reference | Tutorial | Examples | Design