CppCMS
|
This object represents a stream socket: TCP/IP IPv4 or IPv6 or Unix domain stream socket. More...
#include <booster/booster/aio/stream_socket.h>
This object represents a stream socket: TCP/IP IPv4 or IPv6 or Unix domain stream socket.
Shutdown option type
Create a new (closed) stream socket
Create a new (closed) stream socket and attach the object to io_service srv
void booster::aio::stream_socket::async_connect | ( | endpoint const & | ep, |
event_handler const & | h | ||
) |
Connect asynchronously to the remote endpoint ep.
If io_service is not assigned throws system::system_error, all other errors reported via the callback h.
void booster::aio::stream_socket::async_read | ( | mutable_buffer const & | buffer, |
io_handler const & | h | ||
) |
Read asynchronously from the socket to the buffer until all required mount of data is transfered.
The error and the amount of bytes that are transfered are reported via callback. During the operation the buffers (the data range it points to) must remain valid.
If io_service is not assigned throws system::system_error, all other errors reported via the callback h.
void booster::aio::stream_socket::async_read_some | ( | mutable_buffer const & | buffer, |
io_handler const & | h | ||
) |
Read asynchronously from the socket to the buffer.
The error and the amount of bytes that are transfered are reported via callback. During the operation the buffers (the data range it points to) must remain valid.
If io_service is not assigned throws system::system_error, all other errors reported via the callback h.
void booster::aio::stream_socket::async_write | ( | const_buffer const & | buffer, |
io_handler const & | h | ||
) |
Write asynchronously to the socket from the buffer until all required mount of data is transfered.
The error and the amount of bytes that are transfered are reported via callback. During the operation the buffers (the data range it points to) must remain valid.
If io_service is not assigned throws system::system_error, all other errors reported via the callback h.
void booster::aio::stream_socket::async_write_some | ( | const_buffer const & | buffer, |
io_handler const & | h | ||
) |
Write asynchronously to the socket from the buffer.
The error and the amount of bytes that are transfered are reported via callback. During the operation the buffers (the data range it points to) must remain valid.
If io_service is not assigned throws system::system_error, all other errors reported via the callback h.
void booster::aio::stream_socket::connect | ( | endpoint const & | ep | ) |
Connect to the remote endpoint ep
Throws system::system_error if error occurs.
void booster::aio::stream_socket::connect | ( | endpoint const & | ep, |
system::error_code & | e | ||
) |
Connect to the remote endpoint ep
If a error occurs it is assigned to e.
void booster::aio::stream_socket::open | ( | family_type | d | ) |
Opens a new stream socket of a family_type d
Throws system::system_error if error occurs.
void booster::aio::stream_socket::open | ( | family_type | d, |
system::error_code & | e | ||
) |
Opens a new stream socket of a family_type d
If a error occurs it is assigned to e.
size_t booster::aio::stream_socket::read | ( | mutable_buffer const & | buffer | ) |
Read from the socket to the buffer until all required data is transferred. Returns the number of bytes transfered
Throws system::system_error if error occurs.
size_t booster::aio::stream_socket::read | ( | mutable_buffer const & | buffer, |
system::error_code & | e | ||
) |
Read from the socket to the buffer until all required data is transferred. Returns the number of bytes transfered
If a error occurs it is assigned to e.
size_t booster::aio::stream_socket::read_some | ( | mutable_buffer const & | buffer | ) |
Read from the socket to the buffer. Returns the number of bytes transfered
Throws system::system_error if error occurs.
size_t booster::aio::stream_socket::read_some | ( | mutable_buffer const & | buffer, |
system::error_code & | e | ||
) |
Read from the socket to the buffer. Returns the number of bytes transfered
If a error occurs it is assigned to e.
Notify the other side on connection shutdown of a type h
Throws system::system_error if error occurs.
void booster::aio::stream_socket::shutdown | ( | how_type | h, |
system::error_code & | e | ||
) |
Notify the other side on connection shutdown of a type h
If a error occurs it is assigned to e.
size_t booster::aio::stream_socket::write | ( | const_buffer const & | buffer | ) |
Write to the socket from the buffer until all required data is transferred. Returns the number of bytes transfered
Throws system::system_error if error occurs.
size_t booster::aio::stream_socket::write | ( | const_buffer const & | buffer, |
system::error_code & | e | ||
) |
Write to the socket from the buffer until all required data is transferred. Returns the number of bytes transfered
If a error occurs it is assigned to e.
size_t booster::aio::stream_socket::write_some | ( | const_buffer const & | buffer | ) |
Write to the socket from the buffer. Returns the number of bytes transfered
Throws system::system_error if error occurs.
size_t booster::aio::stream_socket::write_some | ( | const_buffer const & | buffer, |
system::error_code & | e | ||
) |
Write to the socket from the buffer. Returns the number of bytes transfered
If a error occurs it is assigned to e.