| Home | Libraries | People | FAQ | More

# boost::asio::stream_socket_service< Protocol > Class Template Reference

Inherits boost::asio::io_service::service.

Inheritance diagram for boost::asio::stream_socket_service< Protocol >:

List of all members.

## Detailed Description

### template<typename Protocol>
class boost::asio::stream_socket_service< Protocol >

Default service implementation for a stream socket.

## Public Types

typedef Protocol | protocol_type
| The protocol type.
typedef Protocol::endpoint | endpoint_type
| The endpoint type.
typedef implementation_defined | implementation_type
| The type of a stream socket implementation.
typedef implementation_defined | native_type
| The native socket type.

## Public Member Functions

| stream_socket_service (boost::asio::io_service &io_service)
| Construct a new stream socket service for the specified io_service.
void | shutdown_service ()
| Destroy all user-defined handler objects owned by the service.
void | construct (implementation_type &impl)
| Construct a new stream socket implementation.
void | destroy (implementation_type &impl)
| Destroy a stream socket implementation.
template<typename Error_Handler>
void | open (implementation_type &impl, const protocol_type &protocol, Error_Handler error_handler)
| Open a stream socket.
template<typename Error_Handler>
void | assign (implementation_type &impl, const protocol_type &protocol, const native_type &native_socket, Error_Handler error_handler)
| Assign an existing native socket to a stream socket.
template<typename Error_Handler>
void | close (implementation_type &impl, Error_Handler error_handler)
| Close a stream socket implementation.
native_type | native (implementation_type &impl)
| Get the native socket implementation.
template<typename Error_Handler>
void | bind (implementation_type &impl, const endpoint_type &endpoint, Error_Handler error_handler)
| Bind the stream socket to the specified local endpoint.
template<typename Error_Handler>
void | connect (implementation_type &impl, const endpoint_type &peer_endpoint, Error_Handler error_handler)
| Connect the stream socket to the specified endpoint.
template<typename Handler>
void | async_connect (implementation_type &impl, const endpoint_type &peer_endpoint, Handler handler)
| Start an asynchronous connect.
template<typename Option, typename Error_Handler>
void | set_option (implementation_type &impl, const Option &option, Error_Handler error_handler)
| Set a socket option.
template<typename Option, typename Error_Handler>
void | get_option (const implementation_type &impl, Option &option, Error_Handler error_handler) const
| Get a socket option.
template<typename IO_Control_Command, typename Error_Handler>
void | io_control (implementation_type &impl, IO_Control_Command &command, Error_Handler error_handler)
| Perform an IO control command on the socket.
template<typename Error_Handler>
endpoint_type | local_endpoint (const implementation_type &impl, Error_Handler error_handler) const
| Get the local endpoint.
template<typename Error_Handler>
endpoint_type | remote_endpoint (const implementation_type &impl, Error_Handler error_handler) const
| Get the remote endpoint.
template<typename Error_Handler>
void | shutdown (implementation_type &impl, socket_base::shutdown_type what, Error_Handler error_handler)
| Disable sends or receives on the socket.
template<typename Const_Buffers, typename Error_Handler>
std::size_t | send (implementation_type &impl, const Const_Buffers &buffers, socket_base::message_flags flags, Error_Handler error_handler)
| Send the given data to the peer.
template<typename Const_Buffers, typename Handler>
void | async_send (implementation_type &impl, const Const_Buffers &buffers, socket_base::message_flags flags, Handler handler)
| Start an asynchronous send.
template<typename Mutable_Buffers, typename Error_Handler>
std::size_t | receive (implementation_type &impl, const Mutable_Buffers &buffers, socket_base::message_flags flags, Error_Handler error_handler)
| Receive some data from the peer.
template<typename Mutable_Buffers, typename Handler>
void | async_receive (implementation_type &impl, const Mutable_Buffers &buffers, socket_base::message_flags flags, Handler handler)
| Start an asynchronous receive.
io_service & | owner ()
| Get the io_service object that owns the service.

## Member Typedef Documentation

template<typename Protocol>

typedef Protocol boost::asio::stream_socket_service< Protocol >::protocol_type

The protocol type.

template<typename Protocol>

typedef Protocol::endpoint boost::asio::stream_socket_service< Protocol >::endpoint_type

The endpoint type.

template<typename Protocol>

typedef implementation_defined boost::asio::stream_socket_service< Protocol >::implementation_type

The type of a stream socket implementation.

template<typename Protocol>

typedef implementation_defined boost::asio::stream_socket_service< Protocol >::native_type

The native socket type.

## Constructor & Destructor Documentation

template<typename Protocol>

boost::asio::stream_socket_service< Protocol >::stream_socket_service | ( | boost::asio::io_service & | io_service | ) | `[explicit]`

Construct a new stream socket service for the specified io_service.

## Member Function Documentation

template<typename Protocol>

void boost::asio::stream_socket_service< Protocol >::shutdown_service | ( |  | ) | `[virtual]`

Destroy all user-defined handler objects owned by the service.

Implements boost::asio::io_service::service.

template<typename Protocol>

void boost::asio::stream_socket_service< Protocol >::construct | ( | implementation_type & | impl | ) |

Construct a new stream socket implementation.

template<typename Protocol>

void boost::asio::stream_socket_service< Protocol >::destroy | ( | implementation_type & | impl | ) |

Destroy a stream socket implementation.

template<typename Protocol>
template<typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::open | ( | implementation_type & | impl,
|  | const protocol_type & | protocol,
|  | Error_Handler | error_handler |
| ) |  |  |

Open a stream socket.

template<typename Protocol>
template<typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::assign | ( | implementation_type & | impl,
|  | const protocol_type & | protocol,
|  | const native_type & | native_socket,
|  | Error_Handler | error_handler |
| ) |  |  |

Assign an existing native socket to a stream socket.

template<typename Protocol>
template<typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::close | ( | implementation_type & | impl,
|  | Error_Handler | error_handler |
| ) |  |  |

Close a stream socket implementation.

template<typename Protocol>

native_type boost::asio::stream_socket_service< Protocol >::native | ( | implementation_type & | impl | ) |

Get the native socket implementation.

template<typename Protocol>
template<typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::bind | ( | implementation_type & | impl,
|  | const endpoint_type & | endpoint,
|  | Error_Handler | error_handler |
| ) |  |  |

Bind the stream socket to the specified local endpoint.

template<typename Protocol>
template<typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::connect | ( | implementation_type & | impl,
|  | const endpoint_type & | peer_endpoint,
|  | Error_Handler | error_handler |
| ) |  |  |

Connect the stream socket to the specified endpoint.

template<typename Protocol>
template<typename Handler>

void boost::asio::stream_socket_service< Protocol >::async_connect | ( | implementation_type & | impl,
|  | const endpoint_type & | peer_endpoint,
|  | Handler | handler |
| ) |  |  |

Start an asynchronous connect.

template<typename Protocol>
template<typename Option, typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::set_option | ( | implementation_type & | impl,
|  | const Option & | option,
|  | Error_Handler | error_handler |
| ) |  |  |

Set a socket option.

template<typename Protocol>
template<typename Option, typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::get_option | ( | const implementation_type & | impl,
|  | Option & | option,
|  | Error_Handler | error_handler |
| ) |  |  | const

Get a socket option.

template<typename Protocol>
template<typename IO_Control_Command, typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::io_control | ( | implementation_type & | impl,
|  | IO_Control_Command & | command,
|  | Error_Handler | error_handler |
| ) |  |  |

Perform an IO control command on the socket.

template<typename Protocol>
template<typename Error_Handler>

endpoint_type boost::asio::stream_socket_service< Protocol >::local_endpoint | ( | const implementation_type & | impl,
|  | Error_Handler | error_handler |
| ) |  |  | const

Get the local endpoint.

template<typename Protocol>
template<typename Error_Handler>

endpoint_type boost::asio::stream_socket_service< Protocol >::remote_endpoint | ( | const implementation_type & | impl,
|  | Error_Handler | error_handler |
| ) |  |  | const

Get the remote endpoint.

template<typename Protocol>
template<typename Error_Handler>

void boost::asio::stream_socket_service< Protocol >::shutdown | ( | implementation_type & | impl,
|  | socket_base::shutdown_type | what,
|  | Error_Handler | error_handler |
| ) |  |  |

Disable sends or receives on the socket.

template<typename Protocol>
template<typename Const_Buffers, typename Error_Handler>

std::size_t boost::asio::stream_socket_service< Protocol >::send | ( | implementation_type & | impl,
|  | const Const_Buffers & | buffers,
|  | socket_base::message_flags | flags,
|  | Error_Handler | error_handler |
| ) |  |  |

Send the given data to the peer.

template<typename Protocol>
template<typename Const_Buffers, typename Handler>

void boost::asio::stream_socket_service< Protocol >::async_send | ( | implementation_type & | impl,
|  | const Const_Buffers & | buffers,
|  | socket_base::message_flags | flags,
|  | Handler | handler |
| ) |  |  |

Start an asynchronous send.

template<typename Protocol>
template<typename Mutable_Buffers, typename Error_Handler>

std::size_t boost::asio::stream_socket_service< Protocol >::receive | ( | implementation_type & | impl,
|  | const Mutable_Buffers & | buffers,
|  | socket_base::message_flags | flags,
|  | Error_Handler | error_handler |
| ) |  |  |

Receive some data from the peer.

template<typename Protocol>
template<typename Mutable_Buffers, typename Handler>

void boost::asio::stream_socket_service< Protocol >::async_receive | ( | implementation_type & | impl,
|  | const Mutable_Buffers & | buffers,
|  | socket_base::message_flags | flags,
|  | Handler | handler |
| ) |  |  |

Start an asynchronous receive.

io_service & boost::asio::io_service::service::owner | ( |  | ) | `[inherited]`

Get the io_service object that owns the service.

| Copyright © 2003 - 2006 Christopher M. Kohlhoff