📄 mod_tcpbase.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 + -