acl/lib_acl_cpp/samples/winaio/AioServer.h

61 lines
1.5 KiB
C
Raw Normal View History

#pragma once
2014-11-19 00:25:21 +08:00
#include "acl_cpp/stream/aio_listen_stream.hpp"
#include "acl_cpp/stream/aio_socket_stream.hpp"
/**
*
2014-11-19 00:25:21 +08:00
*/
class CAcceptedClientCallback : public acl::aio_callback
{
public:
CAcceptedClientCallback(acl::aio_socket_stream* client);
~CAcceptedClientCallback();
/**
*
* @param data {char*}
* @param len {int}
* @return {bool} true
2014-11-19 00:25:21 +08:00
*/
bool read_callback(char* data, int len);
/**
*
* @return {bool} true
2014-11-19 00:25:21 +08:00
*/
bool write_callback();
/**
*
2014-11-19 00:25:21 +08:00
*/
void close_callback();
/**
*
* @return {bool} true
2014-11-19 00:25:21 +08:00
*/
bool timeout_callback();
private:
acl::aio_socket_stream* client_;
int i_;
};
/**
*
2014-11-19 00:25:21 +08:00
*/
class CServerCallback : public acl::aio_accept_callback
{
public:
CServerCallback();
~CServerCallback();
/**
*
* @param client {aio_socket_stream*}
* @return {bool} true
2014-11-19 00:25:21 +08:00
*/
bool accept_callback(acl::aio_socket_stream* client);
};