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

📄 mod_tcpbase.h

📁 Windows CE下的客户端TCP/IP程序
💻 H
字号:
#ifndef _MOD_TCPBASE_H
#define _MOD_TCPBASE_H

#include <afxtempl.h>
#include <afxmt.h>
/************************************************************************/
/* 定义数据缓冲队列数据结构                                             */
/************************************************************************/
typedef struct _tagTcpBuffNode
{
	UINT	_size;
	char	_buff[1024];
}TcpBuffNode;

class TcpBuffQueue
{
public:
	BOOL IsEmpty();
	bool GetData(char *buf, int *plen);
	bool AddData(const char *buf, int len);
	bool FreeBuff();
	bool AllocateBuff(UINT nBuffMax);
	TcpBuffQueue()
	{
      _membase = NULL;
	}
	~TcpBuffQueue();
protected:
private:
    TcpBuffNode *_membase;  // 分配的缓冲池首地址
	CCriticalSection	_mutex; //同步互斥保护
	CTypedPtrList <CPtrList,TcpBuffNode* > _queue_pool; //未用的缓冲池
	CTypedPtrList <CPtrList,TcpBuffNode* > _queue_used; //存放数据的缓冲队列
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -