Clementine
Public Types | Public Member Functions | List of all members
asio::basic_socket_iostream< Protocol, Clock, WaitTraits > Class Template Reference

Iostream interface for a socket. More...

#include <basic_socket_iostream.hpp>

Inheritance diagram for asio::basic_socket_iostream< Protocol, Clock, WaitTraits >:
Inheritance graph
[legend]
Collaboration diagram for asio::basic_socket_iostream< Protocol, Clock, WaitTraits >:
Collaboration graph
[legend]

Public Types

typedef Protocol protocol_type
 The protocol type.
 
typedef Protocol::endpoint endpoint_type
 The endpoint type.
 
typedef Clock clock_type
 The clock type.
 
typedef traits_helper::time_type time_type
 
typedef traits_helper::duration_type duration_type
 
typedef traits_helper::time_type time_point
 
typedef traits_helper::duration_type duration
 

Public Member Functions

 basic_socket_iostream ()
 Construct a basic_socket_iostream without establishing a connection.
 
void close ()
 Close the connection.
 
basic_socket_streambuf< Protocol, Clock, WaitTraits > * rdbuf () const
 Return a pointer to the underlying streambuf.
 
basic_socket< Protocol > & socket ()
 Get a reference to the underlying socket.
 
const asio::error_codeerror () const
 Get the last error associated with the stream. More...
 
time_point expires_at () const
 (Deprecated: Use expiry().) Get the stream's expiry time as an absolute time. More...
 
time_point expiry () const
 Get the stream's expiry time as an absolute time. More...
 
void expires_at (const time_point &expiry_time)
 Set the stream's expiry time as an absolute time. More...
 
void expires_after (const duration &expiry_time)
 Set the stream's expiry time relative to now. More...
 
duration expires_from_now () const
 (Deprecated: Use expiry().) Get the stream's expiry time relative to now. More...
 
void expires_from_now (const duration &expiry_time)
 (Deprecated: Use expires_after().) Set the stream's expiry time relative to now. More...
 

Detailed Description

template<typename Protocol, typename Clock, typename WaitTraits>
class asio::basic_socket_iostream< Protocol, Clock, WaitTraits >

Iostream interface for a socket.

Member Function Documentation

◆ error()

template<typename Protocol , typename Clock , typename WaitTraits >
const asio::error_code& asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::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;
}

◆ expires_after()

template<typename Protocol , typename Clock , typename WaitTraits >
void asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::expires_after ( const duration &  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 asio::error::operation_aborted.

Parameters
expiry_timeThe expiry time to be used for the timer.

◆ expires_at() [1/2]

template<typename Protocol , typename Clock , typename WaitTraits >
time_point asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::expires_at ( ) const
inline

(Deprecated: Use expiry().) Get the stream's expiry time as an absolute time.

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

◆ expires_at() [2/2]

template<typename Protocol , typename Clock , typename WaitTraits >
void asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::expires_at ( const time_point &  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 asio::error::operation_aborted.

Parameters
expiry_timeThe expiry time to be used for the stream.

◆ expires_from_now() [1/2]

template<typename Protocol , typename Clock , typename WaitTraits >
duration asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::expires_from_now ( ) const
inline

(Deprecated: Use expiry().) Get the stream's expiry time relative to now.

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

◆ expires_from_now() [2/2]

template<typename Protocol , typename Clock , typename WaitTraits >
void asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::expires_from_now ( const duration &  expiry_time)
inline

(Deprecated: Use expires_after().) 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 asio::error::operation_aborted.

Parameters
expiry_timeThe expiry time to be used for the timer.

◆ expiry()

template<typename Protocol , typename Clock , typename WaitTraits >
time_point asio::basic_socket_iostream< Protocol, Clock, WaitTraits >::expiry ( ) const
inline

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

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

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