Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

ssl::stream

Provides stream-oriented functionality using SSL.

template<
    typename Stream,
    typename Service = stream_service>
class stream :
  public ssl::stream_base
Types

Name

Description

handshake_type

Different handshake types.

impl_type

The native implementation type of the stream.

lowest_layer_type

The type of the lowest layer.

next_layer_type

The type of the next layer.

service_type

The type of the service that will be used to provide stream operations.

Member Functions

Name

Description

async_handshake

Start an asynchronous SSL handshake.

async_read_some

Start an asynchronous read.

async_shutdown

Asynchronously shut down SSL on the stream.

async_write_some

Start an asynchronous write.

get_io_service

Get the io_service associated with the object.

handshake

Perform SSL handshaking.

impl

Get the underlying implementation in the native type.

in_avail

Determine the amount of data that may be read without blocking.

io_service

(Deprecated: use get_io_service().) Get the io_service associated with the object.

lowest_layer

Get a reference to the lowest layer.

Get a const reference to the lowest layer.

next_layer

Get a reference to the next layer.

peek

Peek at the incoming data on the stream.

read_some

Read some data from the stream.

shutdown

Shut down SSL on the stream.

stream

Construct a stream.

write_some

Write some data to the stream.

~stream

Destructor.

The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.

Thread Safety

Distinct objects: Safe.

Shared objects: Unsafe.

Example

To use the SSL stream template with an ip::tcp::socket, you would write:

boost::asio::io_service io_service;
boost::asio::ssl::context context(io_service, boost::asio::ssl::context::sslv23);
boost::asio::ssl::stream<boost::asio::ip::tcp::socket> sock(io_service, context);

PrevUpHomeNext