CppCMS
Public Types | Public Member Functions
booster::aio::stream_socket Class Reference

This object represents a stream socket: TCP/IP IPv4 or IPv6 or Unix domain stream socket. More...

#include <booster/booster/aio/stream_socket.h>

Inheritance diagram for booster::aio::stream_socket:
booster::aio::basic_socket booster::aio::basic_io_device booster::noncopyable

List of all members.

Public Types

enum  how_type { shut_rd, shut_wr, shut_rdwr }

Public Member Functions

 stream_socket ()
 stream_socket (io_service &srv)
void open (family_type d)
void open (family_type d, system::error_code &e)
void shutdown (how_type h)
void shutdown (how_type h, system::error_code &e)
void connect (endpoint const &ep)
void connect (endpoint const &ep, system::error_code &e)
void async_connect (endpoint const &ep, event_handler const &h)
size_t read_some (mutable_buffer const &buffer)
size_t read_some (mutable_buffer const &buffer, system::error_code &e)
size_t write_some (const_buffer const &buffer)
size_t write_some (const_buffer const &buffer, system::error_code &e)
size_t read (mutable_buffer const &buffer)
size_t write (const_buffer const &buffer)
size_t read (mutable_buffer const &buffer, system::error_code &e)
size_t write (const_buffer const &buffer, system::error_code &e)
void async_read_some (mutable_buffer const &buffer, io_handler const &h)
void async_write_some (const_buffer const &buffer, io_handler const &h)
void async_read (mutable_buffer const &buffer, io_handler const &h)
void async_write (const_buffer const &buffer, io_handler const &h)

Detailed Description

This object represents a stream socket: TCP/IP IPv4 or IPv6 or Unix domain stream socket.


Member Enumeration Documentation

Shutdown option type


Constructor & Destructor Documentation

Create a new (closed) stream socket

Create a new (closed) stream socket and attach the object to io_service srv


Member Function Documentation

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.

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.

Connect to the remote endpoint ep

Throws system::system_error if error occurs.

Connect to the remote endpoint ep

If a error occurs it is assigned to e.

Opens a new stream socket of a family_type d

Throws system::system_error if error occurs.

Opens a new stream socket of a family_type d

If a error occurs it is assigned to e.

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.

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.

Read from the socket to the buffer. Returns the number of bytes transfered

Throws system::system_error if error occurs.

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.

Notify the other side on connection shutdown of a type h

If a error occurs it is assigned to e.

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.

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.

Write to the socket from the buffer. Returns the number of bytes transfered

Throws system::system_error if error occurs.

Write to the socket from the buffer. Returns the number of bytes transfered

If a error occurs it is assigned to e.


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