Realistic 3D camera system
3D camera system components
stream_core.hpp
Go to the documentation of this file.
1 //
2 // ssl/detail/stream_core.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 ASIO_SSL_DETAIL_STREAM_CORE_HPP
12 #define ASIO_SSL_DETAIL_STREAM_CORE_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 
20 #if !defined(ASIO_ENABLE_OLD_SSL)
21 # if defined(ASIO_HAS_BOOST_DATE_TIME)
22 # include "asio/deadline_timer.hpp"
23 # else // defined(ASIO_HAS_BOOST_DATE_TIME)
24 # include "asio/steady_timer.hpp"
25 # endif // defined(ASIO_HAS_BOOST_DATE_TIME)
27 # include "asio/buffer.hpp"
28 #endif // !defined(ASIO_ENABLE_OLD_SSL)
29 
31 
32 namespace asio {
33 namespace ssl {
34 namespace detail {
35 
36 #if !defined(ASIO_ENABLE_OLD_SSL)
37 
39 {
40  // According to the OpenSSL documentation, this is the buffer size that is
41  // sufficient to hold the largest possible TLS record.
42  enum { max_tls_record_size = 17 * 1024 };
43 
45  : engine_(context),
46  pending_read_(io_service),
47  pending_write_(io_service),
52  {
53  pending_read_.expires_at(neg_infin());
54  pending_write_.expires_at(neg_infin());
55  }
56 
58  {
59  }
60 
61  // The SSL engine.
63 
64 #if defined(ASIO_HAS_BOOST_DATE_TIME)
65  // Timer used for storing queued read operations.
66  asio::deadline_timer pending_read_;
67 
68  // Timer used for storing queued write operations.
69  asio::deadline_timer pending_write_;
70 
71  // Helper function for obtaining a time value that always fires.
72  static asio::deadline_timer::time_type neg_infin()
73  {
74  return boost::posix_time::neg_infin;
75  }
76 
77  // Helper function for obtaining a time value that never fires.
78  static asio::deadline_timer::time_type pos_infin()
79  {
80  return boost::posix_time::pos_infin;
81  }
82 #else // defined(ASIO_HAS_BOOST_DATE_TIME)
83  // Timer used for storing queued read operations.
84  asio::steady_timer pending_read_;
85 
86  // Timer used for storing queued write operations.
87  asio::steady_timer pending_write_;
88 
89  // Helper function for obtaining a time value that always fires.
90  static asio::steady_timer::time_point neg_infin()
91  {
92  return (asio::steady_timer::time_point::min)();
93  }
94 
95  // Helper function for obtaining a time value that never fires.
96  static asio::steady_timer::time_point pos_infin()
97  {
98  return (asio::steady_timer::time_point::max)();
99  }
100 #endif // defined(ASIO_HAS_BOOST_DATE_TIME)
101 
102  // Buffer space used to prepare output intended for the transport.
103  std::vector<unsigned char> output_buffer_space_;
104 
105  // A buffer that may be used to prepare output intended for the transport.
107 
108  // Buffer space used to read input intended for the engine.
109  std::vector<unsigned char> input_buffer_space_;
110 
111  // A buffer that may be used to read input intended for the engine.
113 
114  // The buffer pointing to the engine's unconsumed input.
116 };
117 
118 #endif // !defined(ASIO_ENABLE_OLD_SSL)
119 
120 } // namespace detail
121 } // namespace ssl
122 } // namespace asio
123 
125 
126 #endif // ASIO_SSL_DETAIL_STREAM_CORE_HPP
stream_core(SSL_CTX *context, asio::io_service &io_service)
Definition: stream_core.hpp:44
Provides core I/O functionality.
Definition: io_service.hpp:184
Holds a buffer that cannot be modified.
Definition: buffer.hpp:211
asio::steady_timer pending_read_
Definition: stream_core.hpp:84
asio::steady_timer pending_write_
Definition: stream_core.hpp:87
static asio::steady_timer::time_point neg_infin()
Definition: stream_core.hpp:90
std::vector< unsigned char > output_buffer_space_
mutable_buffers_1 buffer(const mutable_buffer &b)
Create a new modifiable buffer from an existing buffer.
Definition: buffer.hpp:706
static asio::steady_timer::time_point pos_infin()
Definition: stream_core.hpp:96
const asio::mutable_buffers_1 input_buffer_
std::vector< unsigned char > input_buffer_space_
const asio::mutable_buffers_1 output_buffer_