1.00.15
C++ Simulated Airline Inventory Management System Library
Toggle main menu visibility
Loading...
Searching...
No Matches
Connection.hpp
Go to the documentation of this file.
1
#ifndef __AIRINV_SVR_CONNECTION_HPP
2
#define __AIRINV_SVR_CONNECTION_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
// Boost
9
#include <boost/asio.hpp>
10
#include <boost/array.hpp>
11
#include <boost/noncopyable.hpp>
12
#include <boost/shared_ptr.hpp>
13
#include <boost/enable_shared_from_this.hpp>
14
// AirInv
15
#include <
airinv/server/Reply.hpp
>
16
#include <
airinv/server/Request.hpp
>
17
18
namespace
AIRINV
{
19
20
// Forward declarations.
21
class
RequestHandler
;
22
23
25
class
Connection
:
public
boost::enable_shared_from_this<Connection>,
26
private
boost::noncopyable {
27
public
:
28
// //////////// Constructors and Destructors /////////////////
31
Connection
(boost::asio::io_service&,
RequestHandler
&);
32
33
34
// /////////// Business Support Methods ////////////////
36
boost::asio::ip::tcp::socket&
socket
();
37
39
void
start
();
40
41
42
private
:
44
void
handleRead (
const
boost::system::error_code& e,
45
std::size_t bytes_transferred);
46
48
void
handleWrite (
const
boost::system::error_code& e);
49
52
boost::asio::io_service::strand _strand;
53
55
boost::asio::ip::tcp::socket _socket;
56
58
RequestHandler
& _requestHandler;
59
61
boost::array<char, 8192> _buffer;
62
64
Request
_request;
65
67
Reply
_reply;
68
};
69
71
typedef
boost::shared_ptr<Connection>
ConnectionShrPtr_T
;
72
73
}
74
#endif
// __AIRINV_SVR_CONNECTION_HPP
Reply.hpp
Request.hpp
AIRINV::Connection::Connection
Connection(boost::asio::io_service &, RequestHandler &)
Definition
Connection.cpp:16
AIRINV::Connection::start
void start()
Definition
Connection.cpp:27
AIRINV::Connection::socket
boost::asio::ip::tcp::socket & socket()
Definition
Connection.cpp:22
AIRINV::RequestHandler
The common handler for all incoming requests.
Definition
RequestHandler.hpp:28
AIRINV
Definition
AIRINV_Master_Service.hpp:38
AIRINV::ConnectionShrPtr_T
boost::shared_ptr< Connection > ConnectionShrPtr_T
Definition
Connection.hpp:71
AIRINV::Reply
Definition
Reply.hpp:18
AIRINV::Request
Definition
Request.hpp:18
Generated on
for AirInv by
1.17.0