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>
Public Types | |
enum | how_type { shut_rd, shut_wr, shut_rdwr } |
Public Types inherited from booster::aio::basic_socket | |
enum | boolean_option_type { tcp_no_delay, keep_alive, reuse_address } |
enum | integer_option_type { receive_buffer_size, send_buffer_size } |
Additional Inherited Members | |
Static Public Member Functions inherited from booster::aio::basic_io_device | |
static bool | would_block (system::error_code const &e) |
Protected Member Functions inherited from booster::aio::basic_io_device | |
bool | dont_block (event_handler const &c) |
bool | dont_block (io_handler const &c) |
This object represents a stream socket: TCP/IP IPv4 or IPv6 or Unix domain stream socket.
Shutdown option type
booster::aio::stream_socket::stream_socket | ( | ) |
Create a new (closed) stream socket
booster::aio::stream_socket::stream_socket | ( | io_service & | srv | ) |
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.
size_t booster::aio::stream_socket::bytes_readable | ( | booster::system::error_code & | e | ) |
Return a number of avalible bytes to read, if error occurs returns 0 and e set to the error code
size_t booster::aio::stream_socket::bytes_readable | ( | ) |
Return a number of avalible bytes to read, if error occurs system_error is thrown
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.
void booster::aio::stream_socket::shutdown | ( | how_type | h | ) |
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.