asio 0.3.8rc3 | Home | Reference | Tutorial | Examples | Design

Examples |

# services::stream_socket_service< Protocol >::send_handler< Handler > Class Template Reference

Collaboration diagram for services::stream_socket_service< Protocol >::send_handler< Handler >:

List of all members.

## Detailed Description

### template<typename Protocol>
template<typename Handler>
class services::stream_socket_service< Protocol >::send_handler< Handler >

Handler to wrap asynchronous send completion.

Definition at line 243 of file stream_socket_service.hpp.

## Public Member Functions

| send_handler (Handler h, logger &l)
void | operator() (const asio::error_code &e, std::size_t bytes_transferred)

## Private Attributes

Handler | handler_
logger & | logger_

## Constructor & Destructor Documentation

template<typename Protocol>
template<typename Handler>

services::stream_socket_service< Protocol >::send_handler< Handler >::send_handler | ( | Handler | h,
|  | logger & | l |
| ) |  |  |

Definition at line 246 of file stream_socket_service.hpp.

    00247       : handler_(h),
    00248         logger_(l)
    00249     {
    00250     }

## Member Function Documentation

template<typename Protocol>
template<typename Handler>

void services::stream_socket_service< Protocol >::send_handler< Handler >::operator() | ( | const asio::error_code & | e,
|  | std::size_t | bytes_transferred |
| ) |  |  |

Definition at line 252 of file stream_socket_service.hpp.

    00254     {
    00255       if (e)
    00256       {
    00257         std::string msg = "Asynchronous send failed: ";
    00258         msg += e.message();
    00259         logger_.log(msg);
    00260       }
    00261       else
    00262       {
    00263         logger_.log("Asynchronous send succeeded");
    00264       }
    00265
    00266       handler_(e, bytes_transferred);
    00267     }

## Member Data Documentation

template<typename Protocol>
template<typename Handler>

Handler services::stream_socket_service< Protocol >::send_handler< Handler >::handler_`[private]`

Definition at line 270 of file stream_socket_service.hpp.

Referenced by services::stream_socket_service< Protocol >::send_handler< Handler >::operator()().

template<typename Protocol>
template<typename Handler>

logger& services::stream_socket_service< Protocol >::send_handler< Handler >::logger_`[private]`

Definition at line 271 of file stream_socket_service.hpp.

Referenced by services::stream_socket_service< Protocol >::send_handler< Handler >::operator()().

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

- services/stream_socket_service.hpp

asio 0.3.8rc3 | Home | Reference | Tutorial | Examples | Design