]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/asio/example/cpp11/http/server/connection_manager.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / asio / example / cpp11 / http / server / connection_manager.hpp
CommitLineData
7c673cae
FG
1//
2// connection_manager.hpp
3// ~~~~~~~~~~~~~~~~~~~~~~
4//
f67539c2 5// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7c673cae
FG
6//
7// Distributed under the Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9//
10
11#ifndef HTTP_CONNECTION_MANAGER_HPP
12#define HTTP_CONNECTION_MANAGER_HPP
13
14#include <set>
15#include "connection.hpp"
16
17namespace http {
18namespace server {
19
20/// Manages open connections so that they may be cleanly stopped when the server
21/// needs to shut down.
22class connection_manager
23{
24public:
25 connection_manager(const connection_manager&) = delete;
26 connection_manager& operator=(const connection_manager&) = delete;
27
28 /// Construct a connection manager.
29 connection_manager();
30
31 /// Add the specified connection to the manager and start it.
32 void start(connection_ptr c);
33
34 /// Stop the specified connection.
35 void stop(connection_ptr c);
36
37 /// Stop all connections.
38 void stop_all();
39
40private:
41 /// The managed connections.
42 std::set<connection_ptr> connections_;
43};
44
45} // namespace server
46} // namespace http
47
48#endif // HTTP_CONNECTION_MANAGER_HPP