📄 client.h
字号:
// client.h : main header file for the CLIENT application
//
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "protocol.h"
class CClientView;
class CClientApp;
class CLocalConnectSocket:public CAsyncSocket
{
DECLARE_DYNAMIC(CLocalConnectSocket)
friend class CClientApp;
private:
CClientApp *m_App;
int m_Port;
int m_AppPort;
private:
CLocalConnectSocket(CClientApp *App,CString IniName,int local);
BOOL Create();
void OnReceive(int nErrorCode);
void RequestReply(const char *ReplyData,int ReplyDataLen);
void Close();
~CLocalConnectSocket();
};
class CClientApp : public CWinApp,public CCSUser
{
public:
CClientApp();
//for debug only
void AddLog(const char *LogString);
void AddSubLog(const char *LogString);
CClientView * m_CurView;
//service request sock
CLocalConnectSocket *m_ListenSock;
CLocalConnectSocket *m_CenterListenSock;
virtual void OnReply(UINT32 SequenceNum,const void *InBuffer,int InBufLen,unsigned long Delay,int Error=0);
// Overrides
virtual BOOL InitInstance();
virtual int ExitInstance();
public:
void ProcessPendingAccept();
void ProcessPendingRead(CLocalConnectSocket*);
// Implementation
private:
UINT m_LocalPort;
UINT m_RemotePort;
UINT m_CenQueuePort;
UINT m_CenMainPort;
CString m_CenterHost;
CString m_RemoteHost;
//network transport protocol entity
CCSEntity *m_ProtocolEntity;
CCSEntity *m_CenterEntity;
void SetCMOSTimer(const char *InBuffer);
//receive a service request from other process
// void OnReceiveServiceRequest(const char *RequestBuf,WORD RequestLen);
public:
virtual BOOL Send(const void *OutBuffer,int OutBufferLen);
//{{AFX_MSG(CClientApp)
afx_msg void OnSockconfig();
afx_msg void OnUpdateSenddata(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#define MAXRECVSERVREQLEN 300
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -