diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:41:18 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:43:11 +0900 |
commit | f763a99a501650eff2c60288aa6f10ef916d769e (patch) | |
tree | 02af7e13f9a38c888ebf340fe764cbe7dae99da9 /doc/html/boost_asio/example/cpp03/http/server3/connection.hpp | |
parent | 5cde13f21d36c7224b0e13d11c4b49379ae5210d (diff) | |
download | boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.gz boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.bz2 boost-f763a99a501650eff2c60288aa6f10ef916d769e.zip |
Imported Upstream version 1.62.0upstream/1.62.0
Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'doc/html/boost_asio/example/cpp03/http/server3/connection.hpp')
-rw-r--r-- | doc/html/boost_asio/example/cpp03/http/server3/connection.hpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/doc/html/boost_asio/example/cpp03/http/server3/connection.hpp b/doc/html/boost_asio/example/cpp03/http/server3/connection.hpp deleted file mode 100644 index 113852652f..0000000000 --- a/doc/html/boost_asio/example/cpp03/http/server3/connection.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// connection.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2015 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 <boost/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_service. - explicit connection(boost::asio::io_service& io_service, - request_handler& handler); - - /// Get the socket associated with the connection. - boost::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 boost::system::error_code& e, - std::size_t bytes_transferred); - - /// Handle completion of a write operation. - void handle_write(const boost::system::error_code& e); - - /// Strand to ensure the connection's handlers are not called concurrently. - boost::asio::io_service::strand strand_; - - /// Socket for the connection. - boost::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 |