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

Examples |

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

## Public Member Functions

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

Definition at line 300 of file stream_socket_service.hpp.

    00301       : handler_(h),
    00302         logger_(l)
    00303     {
    00304     }

## Member Function Documentation

template<typename Protocol>
template<typename Handler>

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

Definition at line 306 of file stream_socket_service.hpp.

    00308     {
    00309       if (e)
    00310       {
    00311         std::string msg = "Asynchronous receive failed: ";
    00312         msg += e.message();
    00313         logger_.log(msg);
    00314       }
    00315       else
    00316       {
    00317         logger_.log("Asynchronous receive succeeded");
    00318       }
    00319
    00320       handler_(e, bytes_transferred);
    00321     }

## Member Data Documentation

template<typename Protocol>
template<typename Handler>

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

Definition at line 324 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 325 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

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