2019-07-27 22:44:32 +08:00
|
|
|
|
// winaioDlg.h : 头文件
|
2014-11-19 00:25:21 +08:00
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include <list>
|
|
|
|
|
#include "resource.h"
|
|
|
|
|
#include "AioServer.h"
|
|
|
|
|
#include "AioClient.h"
|
|
|
|
|
|
|
|
|
|
class CAioTimer;
|
|
|
|
|
class acl::aio_handle;
|
|
|
|
|
class acl::aio_listen_stream;
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// CwinaioDlg 对话框
|
2014-11-19 00:25:21 +08:00
|
|
|
|
class CwinaioDlg : public CDialog
|
|
|
|
|
{
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 构造
|
2014-11-19 00:25:21 +08:00
|
|
|
|
public:
|
2019-07-27 22:44:32 +08:00
|
|
|
|
CwinaioDlg(CWnd* pParent = NULL); // 标准构造函数
|
2014-11-19 00:25:21 +08:00
|
|
|
|
~CwinaioDlg();
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 对话框数据
|
2014-11-19 00:25:21 +08:00
|
|
|
|
enum { IDD = IDD_WINAIO_DIALOG };
|
|
|
|
|
|
|
|
|
|
protected:
|
2019-07-27 22:44:32 +08:00
|
|
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 实现
|
2014-11-19 00:25:21 +08:00
|
|
|
|
protected:
|
|
|
|
|
HICON m_hIcon;
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 生成的消息映射函数
|
2014-11-19 00:25:21 +08:00
|
|
|
|
virtual BOOL OnInitDialog();
|
|
|
|
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
|
|
|
|
afx_msg void OnPaint();
|
|
|
|
|
afx_msg HCURSOR OnQueryDragIcon();
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
|
public:
|
|
|
|
|
afx_msg void OnBnClickedListen();
|
|
|
|
|
afx_msg void OnBnClickedConnect();
|
|
|
|
|
afx_msg void OnBnClickedSetTimer();
|
|
|
|
|
afx_msg void OnBnClickedDelTimer();
|
|
|
|
|
protected:
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// acl::aio_handle 类虚函数
|
2014-11-19 00:25:21 +08:00
|
|
|
|
void on_increase();
|
|
|
|
|
void on_decrease();
|
|
|
|
|
private:
|
|
|
|
|
CServerCallback callback_;
|
|
|
|
|
acl::aio_handle* handle_;
|
|
|
|
|
acl::aio_listen_stream* sstream_;
|
|
|
|
|
bool keep_timer_;
|
|
|
|
|
IO_CTX client_ctx_;
|
|
|
|
|
void InitCtx();
|
|
|
|
|
public:
|
|
|
|
|
afx_msg void OnBnClickedOk();
|
|
|
|
|
afx_msg void OnBnClickedButtonKeepTimer();
|
|
|
|
|
afx_msg void OnBnClickedButtonNoKeepTimer();
|
|
|
|
|
afx_msg void OnBnClickedButtonMemtest();
|
|
|
|
|
private:
|
|
|
|
|
std::list<CAioTimer*> timers_;
|
|
|
|
|
public:
|
|
|
|
|
};
|