diff options
author | 2024-04-22 08:04:58 +1000 | |
---|---|---|
committer | 2024-04-22 08:04:58 +1000 | |
commit | 184292b730f4236bd4840e780fdad97ee060ec84 (patch) | |
tree | 67902161a465fe92aec78ca502de07092b8cde0f /3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp | |
parent | 24154bc1f00790f344120b3a85175d6f616c5ad0 (diff) |
3rdparty/asio: Updated to 1.30.2
Diffstat (limited to '3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp')
-rw-r--r-- | 3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp b/3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp deleted file mode 100644 index 5fa129a6061..00000000000 --- a/3rdparty/asio/src/examples/cpp03/http/server3/connection.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// connection.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2021 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_SERVER3_CONNECTION_HPP -#define HTTP_SERVER3_CONNECTION_HPP - -#include <asio.hpp> -#include <boost/array.hpp> -#include <boost/noncopyable.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/enable_shared_from_this.hpp> -#include "reply.hpp" -#include "request.hpp" -#include "request_handler.hpp" -#include "request_parser.hpp" - -namespace http { -namespace server3 { - -/// Represents a single connection from a client. -class connection - : public boost::enable_shared_from_this<connection>, - private boost::noncopyable -{ -public: - /// Construct a connection with the given io_context. - explicit connection(asio::io_context& io_context, - request_handler& handler); - - /// Get the socket associated with the connection. - asio::ip::tcp::socket& socket(); - - /// Start the first asynchronous operation for the connection. - void start(); - -private: - /// Handle completion of a read operation. - void handle_read(const asio::error_code& e, - std::size_t bytes_transferred); - - /// Handle completion of a write operation. - void handle_write(const asio::error_code& e); - - /// Strand to ensure the connection's handlers are not called concurrently. - asio::strand<asio::io_context::executor_type> strand_; - - /// Socket for the connection. - asio::ip::tcp::socket socket_; - - /// The handler used to process the incoming request. - request_handler& request_handler_; - - /// Buffer for incoming data. - boost::array<char, 8192> buffer_; - - /// The incoming request. - request request_; - - /// The parser for the incoming request. - request_parser request_parser_; - - /// The reply to be sent back to the client. - reply reply_; -}; - -typedef boost::shared_ptr<connection> connection_ptr; - -} // namespace server3 -} // namespace http - -#endif // HTTP_SERVER3_CONNECTION_HPP |