Realistic 3D camera system
3D camera system components
Public Types | Public Member Functions | List of all members
asio::ssl::old::stream< Stream, Service > Class Template Reference

Provides stream-oriented functionality using SSL. More...

#include <stream.hpp>

Inheritance diagram for asio::ssl::old::stream< Stream, Service >:
asio::ssl::stream_base

Public Types

typedef remove_reference< Stream >::type next_layer_type
 The type of the next layer. More...
 
typedef next_layer_type::lowest_layer_type lowest_layer_type
 The type of the lowest layer. More...
 
typedef Service service_type
 The type of the service that will be used to provide stream operations. More...
 
typedef service_type::impl_type impl_type
 The native implementation type of the stream. More...
 
- Public Types inherited from asio::ssl::stream_base
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. More...
 
 ~stream ()
 Destructor. More...
 
asio::io_serviceget_io_service ()
 Get the io_service associated with the object. More...
 
next_layer_typenext_layer ()
 Get a reference to the next layer. More...
 
lowest_layer_typelowest_layer ()
 Get a reference to the lowest layer. More...
 
const lowest_layer_typelowest_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...
 
asio::error_code handshake (handshake_type type, asio::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...
 
asio::error_code shutdown (asio::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, asio::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, asio::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, asio::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 (asio::error_code &ec)
 Determine the amount of data that may be read without blocking. More...
 

Additional Inherited Members

- Protected Member Functions inherited from asio::ssl::stream_base
 ~stream_base ()
 Protected destructor to prevent deletion through this type. More...
 

Detailed Description

template<typename Stream, typename Service = old::stream_service>
class 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.

Definition at line 56 of file stream.hpp.

Member Typedef Documentation

template<typename Stream , typename Service = old::stream_service>
typedef service_type::impl_type asio::ssl::old::stream< Stream, Service >::impl_type

The native implementation type of the stream.

Definition at line 71 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
typedef next_layer_type::lowest_layer_type asio::ssl::old::stream< Stream, Service >::lowest_layer_type

The type of the lowest layer.

Definition at line 65 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
typedef remove_reference<Stream>::type asio::ssl::old::stream< Stream, Service >::next_layer_type

The type of the next layer.

Definition at line 62 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
typedef Service asio::ssl::old::stream< Stream, Service >::service_type

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

Definition at line 68 of file stream.hpp.

Constructor & Destructor Documentation

template<typename Stream , typename Service = old::stream_service>
template<typename Arg , typename Context_Service >
asio::ssl::old::stream< Stream, Service >::stream ( Arg &  arg,
basic_context< Context_Service > &  context 
)
inlineexplicit

Construct a stream.

This constructor creates a stream and initialises the underlying stream object.

Parameters
argThe argument to be passed to initialise the underlying stream.
contextThe SSL context to be used for the stream.

Definition at line 83 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
asio::ssl::old::stream< Stream, Service >::~stream ( )
inline

Destructor.

Definition at line 92 of file stream.hpp.

Member Function Documentation

template<typename Stream , typename Service = old::stream_service>
template<typename HandshakeHandler >
void asio::ssl::old::stream< Stream, Service >::async_handshake ( handshake_type  type,
HandshakeHandler  handler 
)
inline

Start an asynchronous SSL handshake.

This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.

Parameters
typeThe type of handshaking to be performed, i.e. as a client or as a server.
handlerThe 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_code& error // Result of operation.
);

Definition at line 209 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence , typename ReadHandler >
void asio::ssl::old::stream< Stream, Service >::async_read_some ( const MutableBufferSequence &  buffers,
ReadHandler  handler 
)
inline

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
buffersThe 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.
handlerThe 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_code& error, // Result of operation.
std::size_t bytes_transferred // Number of bytes read.
);
Note
The async_read_some operation may not read all of the requested number of bytes. Consider using the asio::async_read function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.

Definition at line 407 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename ShutdownHandler >
void asio::ssl::old::stream< Stream, Service >::async_shutdown ( ShutdownHandler  handler)
inline

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.

Parameters
handlerThe 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_code& error // Result of operation.
);

Definition at line 253 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename ConstBufferSequence , typename WriteHandler >
void asio::ssl::old::stream< Stream, Service >::async_write_some ( const ConstBufferSequence &  buffers,
WriteHandler  handler 
)
inline

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
buffersThe 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.
handlerThe 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_code& error, // Result of operation.
std::size_t bytes_transferred // Number of bytes written.
);
Note
The async_write_some operation may not transmit all of the data to the peer. Consider using the asio::async_write function if you need to ensure that all data is written before the blocking operation completes.

Definition at line 329 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
asio::io_service& asio::ssl::old::stream< Stream, Service >::get_io_service ( )
inline

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.

Returns
A reference to the io_service object that stream will use to dispatch handlers. Ownership is not transferred to the caller.

Definition at line 105 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
void asio::ssl::old::stream< Stream, Service >::handshake ( handshake_type  type)
inline

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.

Parameters
typeThe type of handshaking to be performed, i.e. as a client or as a server.
Exceptions
asio::system_errorThrown on failure.

Definition at line 170 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
asio::error_code asio::ssl::old::stream< Stream, Service >::handshake ( handshake_type  type,
asio::error_code ec 
)
inline

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.

Parameters
typeThe type of handshaking to be performed, i.e. as a client or as a server.
ecSet to indicate what error occurred, if any.

Definition at line 187 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
impl_type asio::ssl::old::stream< Stream, Service >::impl ( )
inline

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.

Definition at line 155 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
std::size_t asio::ssl::old::stream< Stream, Service >::in_avail ( )
inline

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
asio::system_errorThrown on failure.

Definition at line 462 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
std::size_t asio::ssl::old::stream< Stream, Service >::in_avail ( asio::error_code ec)
inline

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.

Parameters
ecSet to indicate what error occurred, if any.
Returns
The number of bytes of data that can be read without blocking.

Definition at line 479 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
lowest_layer_type& asio::ssl::old::stream< Stream, Service >::lowest_layer ( )
inline

Get a reference to the lowest layer.

This function returns a reference to the lowest layer in a stack of stream layers.

Returns
A reference to the lowest layer in the stack of stream layers. Ownership is not transferred to the caller.

Definition at line 131 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
const lowest_layer_type& asio::ssl::old::stream< Stream, Service >::lowest_layer ( ) const
inline

Get a const reference to the lowest layer.

This function returns a const reference to the lowest layer in a stack of stream layers.

Returns
A const reference to the lowest layer in the stack of stream layers. Ownership is not transferred to the caller.

Definition at line 144 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
next_layer_type& asio::ssl::old::stream< Stream, Service >::next_layer ( )
inline

Get a reference to the next layer.

This function returns a reference to the next layer in a stack of stream layers.

Returns
A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.

Definition at line 118 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
std::size_t asio::ssl::old::stream< Stream, Service >::peek ( const MutableBufferSequence &  buffers)
inline

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
buffersThe buffers into which the data will be read.
Returns
The number of bytes read.
Exceptions
asio::system_errorThrown on failure.

Definition at line 426 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
std::size_t asio::ssl::old::stream< Stream, Service >::peek ( const MutableBufferSequence &  buffers,
asio::error_code ec 
)
inline

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
buffersThe buffers into which the data will be read.
ecSet to indicate what error occurred, if any.
Returns
The number of bytes read. Returns 0 if an error occurred.

Definition at line 447 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
std::size_t asio::ssl::old::stream< Stream, Service >::read_some ( const MutableBufferSequence &  buffers)
inline

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
buffersThe buffers into which the data will be read.
Returns
The number of bytes read.
Exceptions
asio::system_errorThrown on failure.
Note
The read_some operation may not read all of the requested number of bytes. Consider using the asio::read function if you need to ensure that the requested amount of data is read before the blocking operation completes.

Definition at line 352 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename MutableBufferSequence >
std::size_t asio::ssl::old::stream< Stream, Service >::read_some ( const MutableBufferSequence &  buffers,
asio::error_code ec 
)
inline

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
buffersThe buffers into which the data will be read.
ecSet 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 asio::read function if you need to ensure that the requested amount of data is read before the blocking operation completes.

Definition at line 377 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
void asio::ssl::old::stream< Stream, Service >::shutdown ( )
inline

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.

Exceptions
asio::system_errorThrown on failure.

Definition at line 221 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
asio::error_code asio::ssl::old::stream< Stream, Service >::shutdown ( asio::error_code ec)
inline

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.

Parameters
ecSet to indicate what error occurred, if any.

Definition at line 235 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename ConstBufferSequence >
std::size_t asio::ssl::old::stream< Stream, Service >::write_some ( const ConstBufferSequence &  buffers)
inline

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
buffersThe data to be written.
Returns
The number of bytes written.
Exceptions
asio::system_errorThrown on failure.
Note
The write_some operation may not transmit all of the data to the peer. Consider using the asio::write function if you need to ensure that all data is written before the blocking operation completes.

Definition at line 275 of file stream.hpp.

template<typename Stream , typename Service = old::stream_service>
template<typename ConstBufferSequence >
std::size_t asio::ssl::old::stream< Stream, Service >::write_some ( const ConstBufferSequence &  buffers,
asio::error_code ec 
)
inline

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
buffersThe data to be written to the stream.
ecSet 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 asio::write function if you need to ensure that all data is written before the blocking operation completes.

Definition at line 300 of file stream.hpp.


The documentation for this class was generated from the following file: