Async read some data from the peer.
template< typename Protocol1, typename IOControlCommand> std::size_t async_read_some( basic_seq_packet_socket< Protocol1, SocketService, Socket> & peer, first protocol, asio::error_code & ec, * buffers, std::size_t max_bytes_to_read); * async_read_some( basic_seq_packet_socket< Protocol1, SocketService, Socket > & peer, first protocol, asio::error_code & ec, * buffers, std::size_t max_bytes_to_read); * async_read_some( basic_seq_packet_socket< Protocol1, SocketService, Socket > & peer, first protocol, asio::error_code & ec, * buffers, std::size_t max_bytes_to_read);
The async_read_some
function is used to asynchronously read a certain
number of bytes of data from a stream socket. The function call always returns
immediately. The asynchronous operation will continue until one of the following
conditions is true:
This operation is implemented in terms of zero or more calls to the stream's
async_read_some function. When the asio::error::eof
error code is returned, this function completes immediately, indicating the
end of the stream.
Otherwise, the asio::error::eof
error code and
the bytes transferred are provided.
This function is used internally as the completion function for the
basic_stream_socket
class of asynchronous operations.
Name |
Description |
---|---|
Start an asynchronous operation to read a certain amount of data from the stream socket. This function is used to asynchronously read data from the stream socket. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
|
|
Start an asynchronous operation to read a certain amount of data from the stream socket. This function is used to asynchronously read data from the stream socket. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
|
|
Start an asynchronous operation to read a certain amount of data from the stream socket. This function is used to asynchronously read data from the stream socket. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
|
Name |
Description |
---|---|
Start an asynchronous operation to write some data to the peer. This function is used to asynchronously write some data to the peer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
|
|
Start an asynchronous operation to write some data to the peer. This function is used to asynchronously write some data to the peer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
|
The asio::asio_service
class is used
to initialize and terminate an application.
It manages the event loop, and is used to register services with the application. The class manages a single event loop, which handles all the event-driven tasks within the application. A basic_io_service is derived from this class.
The asio::asio_service
class:
Derives from the io_service
class.
Handles the event loop.
Contains the service points.
Handles the lifetime.
Name |
Description |
---|---|
Construct an empty service and add the basic_seq_packet_socket asio::error<>< asio::error_code |