|
template<typename Arg , typename Context_Service > |
| stream (Arg &arg, basic_context< Context_Service > &context) |
| Construct a stream. More...
|
|
| ~stream () |
| Destructor. More...
|
|
boost::asio::io_service & | get_io_service () |
| Get the io_service associated with the object. More...
|
|
next_layer_type & | next_layer () |
| Get a reference to the next layer. More...
|
|
lowest_layer_type & | lowest_layer () |
| Get a reference to the lowest layer. More...
|
|
const lowest_layer_type & | lowest_layer () const |
| Get a const reference to the lowest layer. More...
|
|
impl_type | impl () |
| Get the underlying implementation in the native type. More...
|
|
void | handshake (handshake_type type) |
| Perform SSL handshaking. More...
|
|
boost::system::error_code | handshake (handshake_type type, boost::system::error_code &ec) |
| Perform SSL handshaking. More...
|
|
template<typename HandshakeHandler > |
void | async_handshake (handshake_type type, HandshakeHandler handler) |
| Start an asynchronous SSL handshake. More...
|
|
void | shutdown () |
| Shut down SSL on the stream. More...
|
|
boost::system::error_code | shutdown (boost::system::error_code &ec) |
| Shut down SSL on the stream. More...
|
|
template<typename ShutdownHandler > |
void | async_shutdown (ShutdownHandler handler) |
| Asynchronously shut down SSL on the stream. More...
|
|
template<typename ConstBufferSequence > |
std::size_t | write_some (const ConstBufferSequence &buffers) |
| Write some data to the stream. More...
|
|
template<typename ConstBufferSequence > |
std::size_t | write_some (const ConstBufferSequence &buffers, boost::system::error_code &ec) |
| Write some data to the stream. More...
|
|
template<typename ConstBufferSequence , typename WriteHandler > |
void | async_write_some (const ConstBufferSequence &buffers, WriteHandler handler) |
| Start an asynchronous write. More...
|
|
template<typename MutableBufferSequence > |
std::size_t | read_some (const MutableBufferSequence &buffers) |
| Read some data from the stream. More...
|
|
template<typename MutableBufferSequence > |
std::size_t | read_some (const MutableBufferSequence &buffers, boost::system::error_code &ec) |
| Read some data from the stream. More...
|
|
template<typename MutableBufferSequence , typename ReadHandler > |
void | async_read_some (const MutableBufferSequence &buffers, ReadHandler handler) |
| Start an asynchronous read. More...
|
|
template<typename MutableBufferSequence > |
std::size_t | peek (const MutableBufferSequence &buffers) |
| Peek at the incoming data on the stream. More...
|
|
template<typename MutableBufferSequence > |
std::size_t | peek (const MutableBufferSequence &buffers, boost::system::error_code &ec) |
| Peek at the incoming data on the stream. More...
|
|
std::size_t | in_avail () |
| Determine the amount of data that may be read without blocking. More...
|
|
std::size_t | in_avail (boost::system::error_code &ec) |
| Determine the amount of data that may be read without blocking. More...
|
|
template<typename Stream, typename Service = old::stream_service>
class boost::asio::ssl::old::stream< Stream, Service >
Provides stream-oriented functionality using SSL.
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:
- Concepts:
- AsyncReadStream, AsyncWriteStream, Stream, SyncRead_Stream, SyncWriteStream.
template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence , typename ReadHandler >
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.
- Parameters
-
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(
std::size_t bytes_transferred
);
|
- Note
- The async_read_some operation may not read all of the requested number of bytes. Consider using the boost::asio::async_read function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
template<typename Stream , typename Service = old::stream_service>
template<typename ConstBufferSequence , typename WriteHandler >
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.
- Parameters
-
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(
std::size_t bytes_transferred
);
|
- Note
- The async_write_some operation may not transmit all of the data to the peer. Consider using the boost::asio::async_write function if you need to ensure that all data is written before the blocking operation completes.
template<typename Stream , typename Service = old::stream_service>
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.
- Returns
- The number of bytes of data that can be read without blocking.
- Exceptions
-
References boost::asio::s.
template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
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.
- Parameters
-
buffers | The buffers into which the data will be read. |
- Returns
- The number of bytes read.
- Exceptions
-
References boost::asio::s.
template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
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.
- Parameters
-
buffers | The buffers into which the data will be read. |
ec | Set to indicate what error occurred, if any. |
- Returns
- The number of bytes read. Returns 0 if an error occurred.
template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
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.
- Parameters
-
buffers | The buffers into which the data will be read. |
- Returns
- The number of bytes read.
- Exceptions
-
- Note
- The read_some operation may not read all of the requested number of bytes. Consider using the boost::asio::read function if you need to ensure that the requested amount of data is read before the blocking operation completes.
References boost::asio::s.
template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
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.
- Parameters
-
buffers | The buffers into which the data will be read. |
ec | Set to indicate what error occurred, if any. |
- Returns
- The number of bytes read. Returns 0 if an error occurred.
- Note
- The read_some operation may not read all of the requested number of bytes. Consider using the boost::asio::read function if you need to ensure that the requested amount of data is read before the blocking operation completes.
template<typename Stream , typename Service = old::stream_service>
template<typename ConstBufferSequence >
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.
- Parameters
-
buffers | The data to be written. |
- Returns
- The number of bytes written.
- Exceptions
-
- Note
- The write_some operation may not transmit all of the data to the peer. Consider using the boost::asio::write function if you need to ensure that all data is written before the blocking operation completes.
References boost::asio::s.
template<typename Stream , typename Service = old::stream_service>
template<typename ConstBufferSequence >
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.
- Parameters
-
buffers | The data to be written to the stream. |
ec | Set to indicate what error occurred, if any. |
- Returns
- The number of bytes written. Returns 0 if an error occurred.
- Note
- The write_some operation may not transmit all of the data to the peer. Consider using the boost::asio::write function if you need to ensure that all data is written before the blocking operation completes.