| Home | Libraries | People | FAQ | More

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

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

List of all members.

## Detailed Description

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

Handler to wrap asynchronous receive completion.

Definition at line 264 of file stream_socket_service.hpp.

## Public Member Functions

| receive_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 >::receive_handler< Handler >::receive_handler | ( | Handler | h,
|  | logger & | l |
| ) |  |  |

Definition at line 267 of file stream_socket_service.hpp.

    00268       : handler_(h),
    00269         logger_(l)
    00270     {
    00271     }

## Member Function Documentation

template<typename Protocol>
template<typename Handler>

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

Definition at line 273 of file stream_socket_service.hpp.

    00274     {
    00275       if (e)
    00276       {
    00277         std::string msg = "Asynchronous receive failed: ";
    00278         msg += e.what();
    00279         logger_.log(msg);
    00280       }
    00281       else
    00282       {
    00283         logger_.log("Asynchronous receive succeeded");
    00284       }
    00285
    00286       handler_(e, bytes_transferred);
    00287     }

## Member Data Documentation

template<typename Protocol>
template<typename Handler>

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

Definition at line 290 of file stream_socket_service.hpp.

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

template<typename Protocol>
template<typename Handler>

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

Definition at line 291 of file stream_socket_service.hpp.

Referenced by services::stream_socket_service< Protocol >::receive_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