Iostream interface for a socket.
More...
#include <basic_socket_iostream.hpp>
|
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 |
|
template<typename Protocol, typename Clock, typename WaitTraits>
class asio::basic_socket_iostream< Protocol, Clock, WaitTraits >
Iostream interface for a socket.
◆ error()
template<typename Protocol , typename Clock , typename WaitTraits >
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");
{
std::cout <<
"Error: " <<
s.error().message() << std::endl;
}
◆ expires_after()
template<typename Protocol , typename Clock , typename WaitTraits >
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_time | The expiry time to be used for the timer. |
◆ expires_at() [1/2]
template<typename Protocol , typename Clock , typename WaitTraits >
(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 >
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_time | The expiry time to be used for the stream. |
◆ expires_from_now() [1/2]
template<typename Protocol , typename Clock , typename WaitTraits >
(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 >
(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_time | The expiry time to be used for the timer. |
◆ expiry()
template<typename Protocol , typename Clock , typename WaitTraits >
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: