CppCMS

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
booster::aio::basic_socket Class Reference

This class represents a basic Socket object. More...

`#include <booster/booster/aio/basic_socket.h>`

Inheritance diagram for booster::aio::basic_socket:

## Public Types
enum | boolean_option_type { tcp_no_delay, keep_alive, reuse_address }
enum | integer_option_type { receive_buffer_size, send_buffer_size }

## Public Member Functions
| basic_socket ()
| basic_socket (io_service &srv)
void | open (family_type d, socket_type t)
void | open (family_type d, socket_type t, system::error_code &e)
endpoint | local_endpoint (system::error_code &e)
endpoint | local_endpoint ()
endpoint | remote_endpoint (system::error_code &e)
endpoint | remote_endpoint ()
bool | get_option (boolean_option_type opt, system::error_code &e)
bool | get_option (boolean_option_type opt)
void | set_option (boolean_option_type opt, bool v, system::error_code &e)
void | set_option (boolean_option_type opt, bool v)
int | get_option (integer_option_type opt, system::error_code &e)
int | get_option (integer_option_type opt)
void | set_option (integer_option_type opt, int v, system::error_code &e)
void | set_option (integer_option_type opt, int v)
void | bind (endpoint const &ep)
void | bind (endpoint const &ep, system::error_code &e)
Public Member Functions inherited from booster::aio::basic_io_device
| basic_io_device ()
| basic_io_device (io_service &srv)
virtual | ~basic_io_device ()
bool | has_io_service ()
io_service & | get_io_service ()
void | set_io_service (io_service &srv)
void | reset_io_service ()
void | attach (native_type fd)
void | assign (native_type fd)
native_type | release ()
native_type | native ()
void | close ()
void | close (system::error_code &e)
void | on_readable (event_handler const &r)
void | on_writeable (event_handler const &r)
void | cancel ()
basic_io_device & | lowest_layer ()
void | set_non_blocking (bool nonblocking)
void | set_non_blocking (bool nonblocking, system::error_code &e)
void | set_non_blocking_if_needed (bool nonblocking)
void | set_non_blocking_if_needed (bool nonblocking, system::error_code &e)

## 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)

## Detailed Description

This class represents a basic Socket object.

## Member Enumeration Documentation

enum booster::aio::basic_socket::boolean_option_type

Boolean socket options list

enum booster::aio::basic_socket::integer_option_type

Integer socket options list

New in CppCMS 1.2

## Constructor & Destructor Documentation

booster::aio::basic_socket::basic_socket | ( |  | ) |

Create a new socket object

booster::aio::basic_socket::basic_socket | ( | io_service & | srv | ) |

Create a new socket object and connect to the io_service srv

## Member Function Documentation

void booster::aio::basic_socket::bind | ( | endpoint const & | ep | ) |

Bind the opended socket the endpoint ep

Throws system::system_error if error occurs.

New in CppCMS 1.2

void booster::aio::basic_socket::bind | ( | endpoint const & | ep,
|  | system::error_code & | e
| ) |  |

Bind the opended socket the endpoint ep

If a error occurs it is assigned to e.

New in CppCMS 1.2

bool booster::aio::basic_socket::get_option | ( | boolean_option_type | opt,
|  | system::error_code & | e
| ) |  |

Get a value for a boolean_option_type

If a error occurs it is assigned to e.

bool booster::aio::basic_socket::get_option | ( | boolean_option_type | opt | ) |

Get a value for a boolean_option_type Throws system::system_error if error occurs.

int booster::aio::basic_socket::get_option | ( | integer_option_type | opt,
|  | system::error_code & | e
| ) |  |

Get a value for a integer_option_type

If a error occurs it is assigned to e.

New in CppCMS 1.2

int booster::aio::basic_socket::get_option | ( | integer_option_type | opt | ) |

Get a value for a integer_option_type Throws system::system_error if error occurs.

New in CppCMS 1.2

endpoint booster::aio::basic_socket::local_endpoint | ( | system::error_code & | e | ) |

Get a local endpoint for the socket

If a error occurs it is assigned to e.

endpoint booster::aio::basic_socket::local_endpoint | ( |  | ) |

Get a local endpoint for the socket

Throws system::system_error if error occurs.

void booster::aio::basic_socket::open | ( | family_type | d,
|  | socket_type | t
| ) |  |

Open a socket of family_type d and of the protocol (socket_type) t

Throws system::system_error if error occurs.

void booster::aio::basic_socket::open | ( | family_type | d,
|  | socket_type | t,
|  | system::error_code & | e
| ) |  |

Opens a new stream socket of a family_type d

If a error occurs it is assigned to e.

endpoint booster::aio::basic_socket::remote_endpoint | ( | system::error_code & | e | ) |

Get a remote endpoint for the socket

If a error occurs it is assigned to e.

endpoint booster::aio::basic_socket::remote_endpoint | ( |  | ) |

Get a remote endpoint for the socket

Throws system::system_error if error occurs.

void booster::aio::basic_socket::set_option | ( | boolean_option_type | opt,
|  | bool | v,
|  | system::error_code & | e
| ) |  |

Set a value for a boolean_option_type

If a error occurs it is assigned to e.

void booster::aio::basic_socket::set_option | ( | boolean_option_type | opt,
|  | bool | v
| ) |  |

Set a value for a boolean_option_type

Throws system::system_error if error occurs.

void booster::aio::basic_socket::set_option | ( | integer_option_type | opt,
|  | int | v,
|  | system::error_code & | e
| ) |  |

Set a value for a integer_option_type

If a error occurs it is assigned to e.

New in CppCMS 1.2

void booster::aio::basic_socket::set_option | ( | integer_option_type | opt,
|  | int | v
| ) |  |

Set a value for a integer_option_type

Throws system::system_error if error occurs.

New in CppCMS 1.2

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

- booster/aio/basic_socket.h