booster::aio Namespace Reference

This namespace povides and API to asynchronous sockets API, asynchronous timer and event loop handing. More...

## Namespaces

| aio_error
| This namespace includes Booster.Aio specific error codes.

## Classes

class | acceptor
| this class represents a socket that accepts incoming connections More...
class | basic_io_device
| This is a basic object that allows execution of asynchronous operations. More...
class | basic_socket
| This class represents a basic Socket object. More...
class | buffer_impl
| This is a base class that represents a buffer - a set of contiguous chunks of memory that can be transfered over network. More...
class | mutable_buffer
| A mutable buffer - a buffer for read operations. More...
class | const_buffer
| An immutable buffer - buffer for write operations. More...
class | deadline_timer
| A timer object. More...
class | endpoint
| this class represents the connection endpoint, that is generally sockaddr structure in Berkeley sockets API. More...
class | io_service
| this is the central event loop that dispatches all requests. More...
class | reactor
| This class is an abstraction of platform dependent polling API. More...
class | stream_socket
| This object represents a stream socket: TCP/IP IPv4 or IPv6 or Unix domain stream socket. More...
struct | io_events
| the struct that collects multiple event types for polling. More...

## Typedefs

typedef unspecified | native_type
typedef callback< void(system::error_code const &)> | event_handler
typedef callback< void()> | handler
typedef callback< void(system::error_code const &, size_t)> | io_handler

## Enumerations

enum | family_type { pf_unix, pf_inet, pf_inet6 }
enum | socket_type { sock_stream, sock_datagram }

## Functions

const_buffer | buffer (void const *p, size_t n)
mutable_buffer | buffer (void *p, size_t n)
const_buffer | buffer (std::vector< char > const &d)
mutable_buffer | buffer (std::vector< char > &d)
const_buffer | buffer (std::string const &d)
const_buffer | operator+ (const_buffer const &buf, size_t n)
mutable_buffer | operator+ (mutable_buffer const &buf, size_t n)
const_buffer & | operator+= (const_buffer &buf, size_t n)
mutable_buffer & | operator+= (mutable_buffer &buf, size_t n)
const_buffer | operator+ (const_buffer const &b1, const_buffer const &b2)
const_buffer & | operator+= (const_buffer &b1, const_buffer const &b2)
mutable_buffer | operator+ (mutable_buffer const &b1, mutable_buffer const &b2)
mutable_buffer & | operator+= (mutable_buffer &b1, mutable_buffer const &b2)
BOOSTER_API void | socket_pair (stream_socket &s1, stream_socket &s2, system::error_code &e)
BOOSTER_API void | socket_pair (stream_socket &s1, stream_socket &s2)

## Detailed Description

This namespace povides and API to asynchronous sockets API, asynchronous timer and event loop handing.

## Typedef Documentation

typedef callback<void(system::error_code const &)> booster::aio::event_handler

Completion callback - the callback that receives an operation completion result - error_code.

typedef callback<void()> booster::aio::handler

General job handler - the operation that should be executed

typedef callback<void(system::error_code const &,size_t)> booster::aio::io_handler

IO completion callback - the callback that receives an operation completion result - error_code and the amount of bytes transferred

typedef unspecified booster::aio::native_type

Native socket type. int on POSIX platforms and unsigned on Windows.

## Enumeration Type Documentation

enum booster::aio::family_type

Socket family type

enum booster::aio::socket_type

Socket protocol type

## Function Documentation

const_buffer booster::aio::buffer | ( | void const * | p,
|  | size_t | n
| ) |  |

inline

Create a buffer from POD object of size n

References booster::aio::buffer_impl< Pointer >::add().

Referenced by buffer().

mutable_buffer booster::aio::buffer | ( | void * | p,
|  | size_t | n
| ) |  |

inline

Create a buffer from POD object of size n

References booster::aio::buffer_impl< Pointer >::add().

const_buffer booster::aio::buffer | ( | std::vector< char > const & | d | ) |

inline

Create a buffer from std::vector<char>

References buffer().

mutable_buffer booster::aio::buffer | ( | std::vector< char > & | d | ) |

inline

Create a buffer from std::vector<char>

References buffer().

const_buffer booster::aio::buffer | ( | std::string const & | d | ) |

inline

Create a buffer from std::string

References buffer().

const_buffer booster::aio::operator+ | ( | const_buffer const & | buf,
|  | size_t | n
| ) |  |

inline

Create a new buffer by "consuming" n bytes. For example if the buffer has 100 bytes then adding 50 to it would create a buffer with remaining 50 bytes

mutable_buffer booster::aio::operator+ | ( | mutable_buffer const & | buf,
|  | size_t | n
| ) |  |

inline

Create a new buffer by "consuming" n bytes. For example if the buffer has 100 bytes then adding 50 to it would create a buffer with remaining 50 bytes

const_buffer booster::aio::operator+ | ( | const_buffer const & | b1,
|  | const_buffer const & | b2
| ) |  |

inline

Append two buffers

mutable_buffer booster::aio::operator+ | ( | mutable_buffer const & | b1,
|  | mutable_buffer const & | b2
| ) |  |

inline

Append two buffers

const_buffer& booster::aio::operator+= | ( | const_buffer & | buf,
|  | size_t | n
| ) |  |

inline

Consume n bytes from the buffer.

mutable_buffer& booster::aio::operator+= | ( | mutable_buffer & | buf,
|  | size_t | n
| ) |  |

inline

Consume n bytes from the buffer.

const_buffer& booster::aio::operator+= | ( | const_buffer & | b1,
|  | const_buffer const & | b2
| ) |  |

inline

Append one buffer to another

mutable_buffer& booster::aio::operator+= | ( | mutable_buffer & | b1,
|  | mutable_buffer const & | b2
| ) |  |

inline

Append one buffer to another

BOOSTER_API void booster::aio::socket_pair | ( | stream_socket & | s1,
|  | stream_socket & | s2,
|  | system::error_code & | e
| ) |  |

Create a connected pair of stream sockets, under UNIX creates unix-domain-sockets under windows AF_INET sockets

BOOSTER_API void booster::aio::socket_pair | ( | stream_socket & | s1,
|  | stream_socket & | s2
| ) |  |

Create a connected pair of stream sockets, under UNIX creates unix-domain-sockets under windows AF_INET sockets, throws booster::system_error on error