📄 senddatapool.h
字号:
// SendDataPool.h: interface for the CSendDataPool class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SENDDATAPOOL_H__6DC555D6_2E6B_4129_9952_A4680942AC02__INCLUDED_)
#define AFX_SENDDATAPOOL_H__6DC555D6_2E6B_4129_9952_A4680942AC02__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAX_PARAMCOUNT 8
typedef struct _SD_DATA_CELL
{
int nMsg;
int nParamCount;
DWORD dwParams[MAX_PARAMCOUNT];
int nTryedTimes;
CTime nLastSendTime;
int nSendSerial;
} SD_DATA_CELL, *LPSD_DATA_CELL;
class CSendDataPool
{
public:
CSendDataPool();
virtual ~CSendDataPool();
HANDLE m_hSemaphore_Full; // Semaphore of full (output)
HANDLE m_hSemaphore_Empty; // Semaphore of empty (output)
int m_nDataCellSize; // the size of the cells to buffer data(input)
int m_nCellGetIndex; // the cell index to GetMethod(input)
int m_nCellPutIndex; // the cell index to PutMethod(input)
LPSD_DATA_CELL *m_pDataCell;// the data cells array ptr(input)
struct sockaddr m_addrProf; // the address of the dest prof
/* 从数据队列中取出一个数据单元,bIsWait表示是否要等待有数据可读。
返回的消息号,和wParam、lParam两个附带参数。 */
BOOL RemoveNewData( DWORD dwWaitMillSecond = 0 );
SD_DATA_CELL* GetNewDataRef( DWORD dwWaitMillSecond = 0 ); // 获取新数据单元指针
/* 将接收到的数据存放到数据队列中,该函数调用必定会由于存放空间满
而等待,直到将数据确实存放了才返回。 */
BOOL PutNewData( int nMsg, int cParams, DWORD *pParams, DWORD nWaitTime = 5000L );
// Remove all the Cells in the list
void RemoveAllCell();
};
#endif // !defined(AFX_SENDDATAPOOL_H__6DC555D6_2E6B_4129_9952_A4680942AC02__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -