| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /*************************************************************************
- 【文件名】 ClientAssistant.h
- 【功能模块和目的】 客户端辅助类头文件
- 【开发者及日期】 郑石诺 2015/07/20
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- #include "../Public/GlobalDef/TemplateTimer.h"
- class CNetClient;
- /*************************************************************************
- 【类名】 CClientAssistant
- 【功能】
- 【接口说明】 客户端辅助类
- 【开发者及日期】 郑石诺 2015/07/20
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CClientAssistant
- {
- public:
- ~CClientAssistant(void);
- // 属性
- PDU_LINK_TYPE linkType(void) const { return m_LinkType; } // 得到连接类型
- PDU_LINK_TYPE& linkType(void) { return m_LinkType; }
- void getFarLinkInfo(CString& a_FarIp, int& a_FarPort) const; // 对端IP、端口号
- void setFarLinkInfo(LPCTSTR a_FarIp, int a_FarPort);
- void getFarDevInfo(PDU_DEV_TYPE& a_DevType, int& a_DevId) const; // 对端设备类型、ID
- void setFarDevInfo(PDU_DEV_TYPE a_DevType, int a_DevId);
- // 事件响应
- void onConnEstablisthed(void); // 连接建立事件
- void onConnFailed(void); // 连接失败/断开事件
- void onConnRegistOK(void); // 注册成功
- void onConnRegistFailed(void); // 注册失败
-
- private:
- friend class CNetClient;
- CClientAssistant(bool IsAutoReconnect);
- void __setTimer(UINT TimmerId);
- void __killTimer(UINT TimmerId);
- void __onTimerListen(void);
- void __onTimerRecon(void);
- private:
- CNetClient* m_pParent;
- TTimer<CClientAssistant> m_Timer;
- bool m_IsAutoReconnect; // 是否自动重连
- PDU_LINK_TYPE m_LinkType; // 连接类型
- CString m_FarIp; // 对端IP
- UINT m_FarPort; // 对端端口号
- PDU_DEV_TYPE m_FarDevType; // 对端设备类型
- int m_FarDevId; // 对端设备ID
- };
|