mod_tcpbase.h
来自「Windows CE下的客户端TCP/IP程序」· C头文件 代码 · 共 36 行
H
36 行
#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 + =
减小字号Ctrl + -
显示快捷键?