12 #ifndef ASIO_SSL_OLD_STREAM_HPP 13 #define ASIO_SSL_OLD_STREAM_HPP 15 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 21 #include <boost/noncopyable.hpp> 55 template <
typename Stream,
typename Service = old::stream_service>
58 private boost::noncopyable
82 template <
typename Arg,
typename Context_Service>
86 impl_(service_.null())
88 service_.create(impl_, next_layer_, context);
94 service_.destroy(impl_, next_layer_);
107 return next_layer_.get_io_service();
133 return next_layer_.lowest_layer();
146 return next_layer_.lowest_layer();
173 service_.handshake(impl_, next_layer_, type, ec);
190 return service_.handshake(impl_, next_layer_, type, ec);
208 template <
typename HandshakeHandler>
211 service_.async_handshake(impl_, next_layer_, type, handler);
224 service_.shutdown(impl_, next_layer_, ec);
237 return service_.shutdown(impl_, next_layer_, ec);
252 template <
typename ShutdownHandler>
255 service_.async_shutdown(impl_, next_layer_, handler);
274 template <
typename ConstBufferSequence>
278 std::size_t
s = service_.write_some(impl_, next_layer_, buffers, ec);
299 template <
typename ConstBufferSequence>
303 return service_.write_some(impl_, next_layer_, buffers, ec);
328 template <
typename ConstBufferSequence,
typename WriteHandler>
330 WriteHandler handler)
332 service_.async_write_some(impl_, next_layer_, buffers, handler);
351 template <
typename MutableBufferSequence>
355 std::size_t
s = service_.read_some(impl_, next_layer_, buffers, ec);
376 template <
typename MutableBufferSequence>
380 return service_.read_some(impl_, next_layer_, buffers, ec);
406 template <
typename MutableBufferSequence,
typename ReadHandler>
410 service_.async_read_some(impl_, next_layer_, buffers, handler);
425 template <
typename MutableBufferSequence>
429 std::size_t
s = service_.peek(impl_, next_layer_, buffers, ec);
446 template <
typename MutableBufferSequence>
450 return service_.peek(impl_, next_layer_, buffers, ec);
465 std::size_t
s = service_.in_avail(impl_, next_layer_, ec);
481 return service_.in_avail(impl_, next_layer_, ec);
489 service_type& service_;
501 #endif // ASIO_SSL_OLD_STREAM_HPP
std::size_t read_some(const MutableBufferSequence &buffers, asio::error_code &ec)
Read some data from the stream.
next_layer_type & next_layer()
Get a reference to the next layer.
void throw_error(const asio::error_code &err)
Service service_type
The type of the service that will be used to provide stream operations.
Provides core I/O functionality.
asio::error_code shutdown(asio::error_code &ec)
Shut down SSL on the stream.
void async_shutdown(ShutdownHandler handler)
Asynchronously shut down SSL on the stream.
std::size_t in_avail()
Determine the amount of data that may be read without blocking.
service_type::impl_type impl_type
The native implementation type of the stream.
std::size_t read_some(const MutableBufferSequence &buffers)
Read some data from the stream.
void handshake(handshake_type type)
Perform SSL handshaking.
Provides stream-oriented functionality using SSL.
Service & use_service(io_service &ios)
void async_read_some(const MutableBufferSequence &buffers, ReadHandler handler)
Start an asynchronous read.
asio::io_service & get_io_service()
Get the io_service associated with the object.
handshake_type
Different handshake types.
std::size_t in_avail(asio::error_code &ec)
Determine the amount of data that may be read without blocking.
const MutableBufferSequence & buffers
impl_type impl()
Get the underlying implementation in the native type.
std::size_t peek(const MutableBufferSequence &buffers, asio::error_code &ec)
Peek at the incoming data on the stream.
void async_write_some(const ConstBufferSequence &buffers, WriteHandler handler)
Start an asynchronous write.
asio::error_code handshake(handshake_type type, asio::error_code &ec)
Perform SSL handshaking.
Class to represent an error code value.
std::size_t write_some(const ConstBufferSequence &buffers, asio::error_code &ec)
Write some data to the stream.
const lowest_layer_type & lowest_layer() const
Get a const reference to the lowest layer.
std::size_t peek(const MutableBufferSequence &buffers)
Peek at the incoming data on the stream.
void async_handshake(handshake_type type, HandshakeHandler handler)
Start an asynchronous SSL handshake.
next_layer_type::lowest_layer_type lowest_layer_type
The type of the lowest layer.
std::size_t write_some(const ConstBufferSequence &buffers)
Write some data to the stream.
stream(Arg &arg, basic_context< Context_Service > &context)
Construct a stream.
lowest_layer_type & lowest_layer()
Get a reference to the lowest layer.
remove_reference< Stream >::type next_layer_type
The type of the next layer.
void shutdown()
Shut down SSL on the stream.