Reference | Class Hierarchy | Class Index | Member Index |
Inheritance diagram for asio::ssl::stream< Stream, Service >:
The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
Public Types | |
typedef boost::remove_reference< Stream >::type | next_layer_type |
The type of the next layer. | |
typedef next_layer_type::lowest_layer_type | lowest_layer_type |
The type of the lowest layer. | |
typedef next_layer_type::error_type | error_type |
The type used for reporting errors. | |
typedef Service | service_type |
The type of the service that will be used to provide stream operations. | |
typedef service_type::impl_type | impl_type |
The native implementation type of the stream. | |
client | |
Perform handshaking as a client. | |
server | |
Perform handshaking as a server. | |
enum | handshake_type { client, server } |
Different handshake types. More... | |
Public Member Functions | |
template<typename Arg, typename Context_Service> | |
stream (Arg &arg, basic_context< Context_Service > &context) | |
Construct a stream. | |
~stream () | |
Destructor. | |
asio::io_service & | io_service () |
Get the io_service associated with the object. | |
next_layer_type & | next_layer () |
Get a reference to the next layer. | |
lowest_layer_type & | lowest_layer () |
Get a reference to the lowest layer. | |
impl_type | impl () |
Get the underlying implementation in the native type. | |
void | handshake (handshake_type type) |
Perform SSL handshaking. | |
template<typename Error_Handler> | |
void | handshake (handshake_type type, Error_Handler error_handler) |
Perform SSL handshaking. | |
template<typename Handler> | |
void | async_handshake (handshake_type type, Handler handler) |
Start an asynchronous SSL handshake. | |
void | shutdown () |
Shut down SSL on the stream. | |
template<typename Error_Handler> | |
void | shutdown (Error_Handler error_handler) |
Shut down SSL on the stream. | |
template<typename Handler> | |
void | async_shutdown (Handler handler) |
Asynchronously shut down SSL on the stream. | |
template<typename Const_Buffers> | |
std::size_t | write_some (const Const_Buffers &buffers) |
Write some data to the stream. | |
template<typename Const_Buffers, typename Error_Handler> | |
std::size_t | write_some (const Const_Buffers &buffers, Error_Handler error_handler) |
Write some data to the stream. | |
template<typename Const_Buffers, typename Handler> | |
void | async_write_some (const Const_Buffers &buffers, Handler handler) |
Start an asynchronous write. | |
template<typename Mutable_Buffers> | |
std::size_t | read_some (const Mutable_Buffers &buffers) |
Read some data from the stream. | |
template<typename Mutable_Buffers, typename Error_Handler> | |
std::size_t | read_some (const Mutable_Buffers &buffers, Error_Handler error_handler) |
Read some data from the stream. | |
template<typename Mutable_Buffers, typename Handler> | |
void | async_read_some (const Mutable_Buffers &buffers, Handler handler) |
Start an asynchronous read. | |
template<typename Mutable_Buffers> | |
std::size_t | peek (const Mutable_Buffers &buffers) |
Peek at the incoming data on the stream. | |
template<typename Mutable_Buffers, typename Error_Handler> | |
std::size_t | peek (const Mutable_Buffers &buffers, Error_Handler error_handler) |
Peek at the incoming data on the stream. | |
std::size_t | in_avail () |
Determine the amount of data that may be read without blocking. | |
template<typename Error_Handler> | |
std::size_t | in_avail (Error_Handler error_handler) |
Determine the amount of data that may be read without blocking. | |
Private Attributes | |
Stream | next_layer_ |
The next layer. | |
service_type & | service_ |
The backend service implementation. | |
impl_type | impl_ |
The underlying native implementation. |
typedef boost::remove_reference<Stream>::type asio::ssl::stream< Stream, Service >::next_layer_type |
The type of the next layer.
typedef next_layer_type::lowest_layer_type asio::ssl::stream< Stream, Service >::lowest_layer_type |
The type of the lowest layer.
typedef next_layer_type::error_type asio::ssl::stream< Stream, Service >::error_type |
The type used for reporting errors.
typedef Service asio::ssl::stream< Stream, Service >::service_type |
The type of the service that will be used to provide stream operations.
typedef service_type::impl_type asio::ssl::stream< Stream, Service >::impl_type |
The native implementation type of the stream.
enum asio::ssl::stream_base::handshake_type [inherited] |
asio::ssl::stream< Stream, Service >::stream | ( | Arg & | arg, | |
basic_context< Context_Service > & | context | |||
) | [explicit] |
Construct a stream.
This constructor creates a stream and initialises the underlying stream object.
arg | The argument to be passed to initialise the underlying stream. | |
context | The SSL context to be used for the stream. |
asio::ssl::stream< Stream, Service >::~stream | ( | ) |
Destructor.
asio::io_service& asio::ssl::stream< Stream, Service >::io_service | ( | ) |
Get the io_service associated with the object.
This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
next_layer_type& asio::ssl::stream< Stream, Service >::next_layer | ( | ) |
Get a reference to the next layer.
This function returns a reference to the next layer in a stack of stream layers.
lowest_layer_type& asio::ssl::stream< Stream, Service >::lowest_layer | ( | ) |
Get a reference to the lowest layer.
This function returns a reference to the lowest layer in a stack of stream layers.
impl_type asio::ssl::stream< Stream, Service >::impl | ( | ) |
Get the underlying implementation in the native type.
This function may be used to obtain the underlying implementation of the context. This is intended to allow access to stream functionality that is not otherwise provided.
void asio::ssl::stream< Stream, Service >::handshake | ( | handshake_type | type | ) |
Perform SSL handshaking.
This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
type | The type of handshaking to be performed, i.e. as a client or as a server. |
asio::error | Thrown on failure. |
void asio::ssl::stream< Stream, Service >::handshake | ( | handshake_type | type, | |
Error_Handler | error_handler | |||
) |
Perform SSL handshaking.
This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
type | The type of handshaking to be performed, i.e. as a client or as a server. | |
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const asio::error& error // Result of operation ); |
void asio::ssl::stream< Stream, Service >::async_handshake | ( | handshake_type | type, | |
Handler | handler | |||
) |
Start an asynchronous SSL handshake.
This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
type | The type of handshaking to be performed, i.e. as a client or as a server. | |
handler | The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( const asio::error& error, // Result of operation ); |
void asio::ssl::stream< Stream, Service >::shutdown | ( | ) |
Shut down SSL on the stream.
This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
asio::error | Thrown on failure. |
void asio::ssl::stream< Stream, Service >::shutdown | ( | Error_Handler | error_handler | ) |
Shut down SSL on the stream.
This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const asio::error& error // Result of operation ); |
void asio::ssl::stream< Stream, Service >::async_shutdown | ( | Handler | handler | ) |
Asynchronously shut down SSL on the stream.
This function is used to asynchronously shut down SSL on the stream. This function call always returns immediately.
handler | The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( const asio::error& error, // Result of operation ); |
std::size_t asio::ssl::stream< Stream, Service >::write_some | ( | const Const_Buffers & | buffers | ) |
Write some data to the stream.
This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
buffers | The data to be written. |
asio::error | Thrown on failure. |
std::size_t asio::ssl::stream< Stream, Service >::write_some | ( | const Const_Buffers & | buffers, | |
Error_Handler | error_handler | |||
) |
Write some data to the stream.
This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
buffers | The data to be written to the stream. | |
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const asio::error& error // Result of operation. ); |
void asio::ssl::stream< Stream, Service >::async_write_some | ( | const Const_Buffers & | buffers, | |
Handler | handler | |||
) |
Start an asynchronous write.
This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
buffers | The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called. | |
handler | The handler to be called when the write operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( const asio::error& error, // Result of operation. std::size_t bytes_transferred // Number of bytes written. ); |
std::size_t asio::ssl::stream< Stream, Service >::read_some | ( | const Mutable_Buffers & | buffers | ) |
Read some data from the stream.
This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
buffers | The buffers into which the data will be read. |
asio::error | Thrown on failure. |
std::size_t asio::ssl::stream< Stream, Service >::read_some | ( | const Mutable_Buffers & | buffers, | |
Error_Handler | error_handler | |||
) |
Read some data from the stream.
This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
buffers | The buffers into which the data will be read. | |
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const asio::error& error // Result of operation. ); |
void asio::ssl::stream< Stream, Service >::async_read_some | ( | const Mutable_Buffers & | buffers, | |
Handler | handler | |||
) |
Start an asynchronous read.
This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
buffers | The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called. | |
handler | The handler to be called when the read operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( const asio::error& error, // Result of operation. std::size_t bytes_transferred // Number of bytes read. ); |
std::size_t asio::ssl::stream< Stream, Service >::peek | ( | const Mutable_Buffers & | buffers | ) |
Peek at the incoming data on the stream.
This function is used to peek at the incoming data on the stream, without removing it from the input queue. The function call will block until data has been read successfully or an error occurs.
buffers | The buffers into which the data will be read. |
asio::error | Thrown on failure. |
std::size_t asio::ssl::stream< Stream, Service >::peek | ( | const Mutable_Buffers & | buffers, | |
Error_Handler | error_handler | |||
) |
Peek at the incoming data on the stream.
This function is used to peek at the incoming data on the stream, withoutxi removing it from the input queue. The function call will block until data has been read successfully or an error occurs.
buffers | The buffers into which the data will be read. | |
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const asio::error& error // Result of operation. ); |
std::size_t asio::ssl::stream< Stream, Service >::in_avail | ( | ) |
Determine the amount of data that may be read without blocking.
This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
asio::error | Thrown on failure. |
std::size_t asio::ssl::stream< Stream, Service >::in_avail | ( | Error_Handler | error_handler | ) |
Determine the amount of data that may be read without blocking.
This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const asio::error& error // Result of operation ); |
Stream asio::ssl::stream< Stream, Service >::next_layer_ [private] |
The next layer.
service_type& asio::ssl::stream< Stream, Service >::service_ [private] |
The backend service implementation.
impl_type asio::ssl::stream< Stream, Service >::impl_ [private] |
The underlying native implementation.