PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/asio/ssl/detail/stream_core.hpp

http://hadesmem.googlecode.com/
C++ Header | 88 lines | 50 code | 21 blank | 17 comment | 1 complexity | ceecef944e2b3f22e1c0a4f5bfdf9854 MD5 | raw file
 1//
 2// ssl/detail/stream_core.hpp
 3// ~~~~~~~~~~~~~~~~~~~~~~~~~~
 4//
 5// Copyright (c) 2003-2011 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 BOOST_ASIO_SSL_DETAIL_STREAM_CORE_HPP
12#define BOOST_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 <boost/asio/detail/config.hpp>
19
20#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
21# include <boost/asio/deadline_timer.hpp>
22# include <boost/asio/ssl/detail/engine.hpp>
23# include <boost/asio/buffer.hpp>
24#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
25
26#include <boost/asio/detail/push_options.hpp>
27
28namespace boost {
29namespace asio {
30namespace ssl {
31namespace detail {
32
33#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
34
35struct stream_core
36{
37  stream_core(SSL_CTX* context, boost::asio::io_service& io_service)
38    : engine_(context),
39      pending_read_(io_service),
40      pending_write_(io_service),
41      output_buffer_space_(16384),
42      output_buffer_(boost::asio::buffer(output_buffer_space_)),
43      input_buffer_space_(16384),
44      input_buffer_(boost::asio::buffer(input_buffer_space_))
45  {
46    pending_read_.expires_at(boost::posix_time::neg_infin);
47    pending_write_.expires_at(boost::posix_time::neg_infin);
48  }
49
50  ~stream_core()
51  {
52  }
53
54  // The SSL engine.
55  engine engine_;
56
57  // Timer used for storing queued read operations.
58  boost::asio::deadline_timer pending_read_;
59
60  // Timer used for storing queued write operations.
61  boost::asio::deadline_timer pending_write_;
62
63  // Buffer space used to prepare output intended for the transport.
64  std::vector<unsigned char> output_buffer_space_; 
65
66  // A buffer that may be used to prepare output intended for the transport.
67  const boost::asio::mutable_buffers_1 output_buffer_; 
68
69  // Buffer space used to read input intended for the engine.
70  std::vector<unsigned char> input_buffer_space_; 
71
72  // A buffer that may be used to read input intended for the engine.
73  const boost::asio::mutable_buffers_1 input_buffer_;
74
75  // The buffer pointing to the engine's unconsumed input.
76  boost::asio::const_buffer input_;
77};
78
79#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
80
81} // namespace detail
82} // namespace ssl
83} // namespace asio
84} // namespace boost
85
86#include <boost/asio/detail/pop_options.hpp>
87
88#endif // BOOST_ASIO_SSL_DETAIL_STREAM_CORE_HPP