| 12345678910111213141516171819202122232425262728293031323334 |
- #pragma once
- #include <iostream>
- #include <cstdlib>
- #include "templetgks.h"
- #include <cstring>
- enum { max_length = 5120 };
- typedef struct HDDSNetCMD
- {
- int nCMDtype; //网络包类型
- int flags; //标识(数据方向)
- int nDateLen; //参数长度Bytes
- char cData[max_length];
-
- int GetInfoLen() { return 12; }; //固定长度,cmd的头信息
- int GetDataLen() { return nDateLen; }; //参数长度
- int GetBufLen() { return (GetInfoLen() + GetDataLen()); } //有效数据长度
- bool SetcData(int nType, void* pData,long nLen)
- {
- nCMDtype = nType;
- nDateLen = nLen;
- if (nDateLen > max_length)
- {
- return false;
- }
- memcpy(cData, pData, nLen);
- return true;
- }
-
- }HDDSCMD,*LPHDDSCMD;
- typedef GksQueue<HDDSCMD> HDDSCMDQueue;
|