Sha256: 2fce2555aaf0e6751dc05d7e63dfad77169e1a00dc71212c2b9757f7b6ee7086

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 KB

Contents

//
// connection_manager.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef HTTP_CONNECTION_MANAGER_HPP
#define HTTP_CONNECTION_MANAGER_HPP

#include <set>
#include "connection.hpp"

namespace http {
namespace server {

/// Manages open connections so that they may be cleanly stopped when the server
/// needs to shut down.
class connection_manager
{
public:
  connection_manager(const connection_manager&) = delete;
  connection_manager& operator=(const connection_manager&) = delete;

  /// Construct a connection manager.
  connection_manager();

  /// Add the specified connection to the manager and start it.
  void start(connection_ptr c);

  /// Stop the specified connection.
  void stop(connection_ptr c);

  /// Stop all connections.
  void stop_all();

private:
  /// The managed connections.
  std::set<connection_ptr> connections_;
};

} // namespace server
} // namespace http

#endif // HTTP_CONNECTION_MANAGER_HPP

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
couchbase-3.0.0.alpha.4-x86_64-linux ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.4-x86_64-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.4-universal-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.4 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.3-x86_64-linux ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.3-x86_64-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.3-universal-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.3 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.2-x86_64-linux ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.2-x86_64-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.2-universal-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.2 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.1-x86_64-linux ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.1-x86_64-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.1-universal-darwin-19 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp
couchbase-3.0.0.alpha.1 ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp