| Home | Libraries | People | FAQ | More

# 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 212 of file stream_socket_service.hpp.

## Public Member Functions

| send_handler (Handler h, logger &l)
void | operator() (const boost::asio::error &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 215 of file stream_socket_service.hpp.

    00216       : handler_(h),
    00217         logger_(l)
    00218     {
    00219     }

## Member Function Documentation

template<typename Protocol>
template<typename Handler>

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

Definition at line 221 of file stream_socket_service.hpp.

    00222     {
    00223       if (e)
    00224       {
    00225         std::string msg = "Asynchronous send failed: ";
    00226         msg += e.what();
    00227         logger_.log(msg);
    00228       }
    00229       else
    00230       {
    00231         logger_.log("Asynchronous send succeeded");
    00232       }
    00233
    00234       handler_(e, bytes_transferred);
    00235     }

## Member Data Documentation

template<typename Protocol>
template<typename Handler>

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

Definition at line 238 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 239 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

| Copyright © 2003 - 2006 Christopher M. Kohlhoff