Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService > Class Template Reference

Iostream interface for a socket. More...

#include <basic_socket_iostream.hpp>

Inheritance diagram for boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >:
Collaboration diagram for boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >:

Public Types

typedef Protocol::endpoint endpoint_type
 The endpoint type. More...
 
typedef traits_helper::time_type time_type
 
typedef
traits_helper::duration_type 
duration_type
 

Public Member Functions

 basic_socket_iostream ()
 Construct a basic_socket_iostream without establishing a connection. More...
 
void close ()
 Close the connection. More...
 
basic_socket_streambuf
< Protocol,
StreamSocketService, Time,
TimeTraits, TimerService > * 
rdbuf () const
 Return a pointer to the underlying streambuf. More...
 
const boost::system::error_codeerror () const
 Get the last error associated with the stream. More...
 
time_type expires_at () const
 Get the stream's expiry time as an absolute time. More...
 
void expires_at (const time_type &expiry_time)
 Set the stream's expiry time as an absolute time. More...
 
duration_type expires_from_now () const
 Get the timer's expiry time relative to now. More...
 
void expires_from_now (const duration_type &expiry_time)
 Set the stream's expiry time relative to now. More...
 

Private Attributes

basic_socket_streambuf
< Protocol,
StreamSocketService, Time,
TimeTraits, TimerService > 
streambuf_
 

Detailed Description

template<typename Protocol, typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
class boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >

Iostream interface for a socket.

Member Typedef Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
typedef traits_helper::duration_type boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::duration_type
template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
typedef Protocol::endpoint boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::endpoint_type

The endpoint type.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
typedef traits_helper::time_type boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::time_type

Constructor & Destructor Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::basic_socket_iostream ( )
inline

Construct a basic_socket_iostream without establishing a connection.

Member Function Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
void boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::close ( )
inline
template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
const boost::system::error_code& boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::error ( ) const
inline

Get the last error associated with the stream.

Returns
An error_code corresponding to the last error from the stream.
Example
To print the error associated with a failure to establish a connection:
tcp::iostream s("www.boost.org", "http");
if (!s)
{
std::cout << "Error: " << s.error().message() << std::endl;
}

References boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::rdbuf().

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
time_type boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::expires_at ( ) const
inline

Get the stream's expiry time as an absolute time.

Returns
An absolute time value representing the stream's expiry time.

References boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::rdbuf().

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
void boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::expires_at ( const time_type expiry_time)
inline

Set the stream's expiry time as an absolute time.

This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error boost::asio::error::operation_aborted.

Parameters
expiry_timeThe expiry time to be used for the stream.

References boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::rdbuf().

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
duration_type boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::expires_from_now ( ) const
inline

Get the timer's expiry time relative to now.

Returns
A relative time value representing the stream's expiry time.

References boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::rdbuf().

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
void boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::expires_from_now ( const duration_type expiry_time)
inline

Set the stream's expiry time relative to now.

This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error boost::asio::error::operation_aborted.

Parameters
expiry_timeThe expiry time to be used for the timer.

References boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::rdbuf().

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>, typename Time = steady_timer::clock_type, typename TimeTraits = steady_timer::traits_type, typename TimerService = steady_timer::service_type>
basic_socket_streambuf<Protocol, StreamSocketService, Time, TimeTraits, TimerService>* boost::asio::basic_socket_iostream< Protocol, StreamSocketService, Time, TimeTraits, TimerService >::rdbuf ( ) const
inline

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