⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.h

📁 中间件编程,该程序用于传输客户端数据到服务器,可运行于WINDOWS2000,2003,XP,98等系统
💻 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 + -