Realistic 3D camera system
3D camera system components
connection.hpp
Go to the documentation of this file.
1 //
2 // connection.hpp
3 // ~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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_HPP
12 #define HTTP_CONNECTION_HPP
13 
14 #include <asio.hpp>
15 #include <boost/array.hpp>
16 #include <boost/noncopyable.hpp>
17 #include <boost/shared_ptr.hpp>
18 #include <boost/enable_shared_from_this.hpp>
19 #include "reply.hpp"
20 #include "request.hpp"
21 #include "request_handler.hpp"
22 #include "request_parser.hpp"
23 
24 namespace http {
25 namespace server {
26 
27 class connection_manager;
28 
31  : public boost::enable_shared_from_this<connection>,
32  private boost::noncopyable
33 {
34 public:
36  explicit connection(asio::io_service& io_service,
37  connection_manager& manager, request_handler& handler);
38 
41 
43  void start();
44 
46  void stop();
47 
48 private:
50  void handle_read(const asio::error_code& e,
51  std::size_t bytes_transferred);
52 
54  void handle_write(const asio::error_code& e);
55 
57  asio::ip::tcp::socket socket_;
58 
60  connection_manager& connection_manager_;
61 
63  request_handler& request_handler_;
64 
67 
69  request request_;
70 
72  request_parser request_parser_;
73 
75  reply reply_;
76 };
77 
78 typedef boost::shared_ptr<connection> connection_ptr;
79 
80 } // namespace server
81 } // namespace http
82 
83 #endif // HTTP_CONNECTION_HPP
Provides core I/O functionality.
Definition: io_service.hpp:184
pylon Camera Software Suite for Linux for Use with Basler Gigabit the pylon Viewer and the IP Configurator applications might not be available System I340 and I350 series Although the pylon software will work with any GigE network we would recommend to use one of these adapters USB For U3V devices a USB3 capable USB controller is necessary For best performance and stability we highly recommend a kernel the following settings should be i e
Provides stream-oriented socket functionality.
The common handler for all incoming requests.
connection(asio::io_service &io_service, connection_manager &manager, request_handler &handler)
Construct a connection with the given io_service.
Definition: connection.cpp:20
void stop()
Stop all asynchronous operations associated with the connection.
Definition: connection.cpp:41
asio::ip::tcp::socket & socket()
Get the socket associated with the connection.
Definition: connection.cpp:28
boost::shared_ptr< connection > connection_ptr
Definition: connection.hpp:78
A reply to be sent to a client.
Definition: reply.hpp:23
Class to represent an error code value.
Definition: error_code.hpp:80
Represents a single connection from a client.
Definition: connection.hpp:30
Parser for incoming requests.
void start()
Start the first asynchronous operation for the connection.
Definition: connection.cpp:33
A request received from a client.
Definition: request.hpp:22