2 #include "../acl_cpp_define.hpp" 3 #include "../stdlib/noncopyable.hpp" 6 #if defined(_WIN32) || defined(_WIN64) 133 int del_timeout_callback(
aio_callback* callback = NULL);
141 int disable_close_callback(
aio_callback* callback = NULL);
149 int disable_timeout_callback(
aio_callback* callback = NULL);
157 int enable_close_callback(
aio_callback* callback = NULL);
165 int enable_timeout_callback(
aio_callback* callback = NULL);
183 #if defined(_WIN32) || defined(_WIN64) 184 SOCKET get_socket(
void)
const;
185 SOCKET sock_handle(
void)
const 187 int get_socket(
void)
const;
201 const char* get_peer(
bool full =
false)
const;
210 const char* get_local(
bool full =
false)
const;
250 virtual void destroy(
void);
256 void hook_error(
void);
261 STATUS_HOOKED_ERROR = 1,
262 STATUS_HOOKED_READ = 1 << 1,
263 STATUS_HOOKED_WRITE = 1 << 2,
264 STATUS_HOOKED_OPEN = 1 << 3,
267 STATUS_CONN_OPENED = 1 << 4,
271 std::list<AIO_CALLBACK*>* close_callbacks_;
272 std::list<AIO_CALLBACK*>* timeout_callbacks_;
278 std::string ip_peer_;
279 std::string ip_local_;
281 const char* get_ip(
const char* addr, std::string& out);
284 #if defined(_WIN32) || defined(_WIN64) 285 static int read_hook(SOCKET fd,
void *buf,
size_t len,
287 static int send_hook(SOCKET fd,
const void *buf,
size_t len,
290 static int fread_hook(HANDLE fd,
void *buf,
size_t len,
292 static int fsend_hook(HANDLE fd,
const void *buf,
size_t len,
295 static int read_hook(
int fd,
void *buf,
size_t len,
297 static int send_hook(
int fd,
const void *buf,
size_t len,
300 static int fread_hook(
int fd,
void *buf,
size_t len,
302 static int fsend_hook(
int fd,
const void *buf,
size_t len,
virtual void close_callback(void)
virtual bool read_wakeup(void)
virtual bool write_callback(void)
int sock_handle(void) const
virtual ~aio_callback(void)
virtual bool read_callback(char *data, int len)
virtual bool write_wakeup(void)
virtual bool timeout_callback(void)