40 lines
829 B
C++
40 lines
829 B
C++
// ResponseManager.h: interface for the CResponseManager class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef ResponseManagerH
|
|
#define ResponseManagerH
|
|
|
|
#include "thread.h"
|
|
#include "MessageDef.h"
|
|
|
|
typedef struct tagResponse {
|
|
TNETMESSAGE response;
|
|
int iTimeCount;
|
|
// UINT ip;
|
|
// USHORT port;
|
|
int iExtra;
|
|
} TRESPONSENODE;
|
|
|
|
#include <list>
|
|
using namespace std;
|
|
typedef list< TRESPONSENODE* > TRESPONSELIST;
|
|
|
|
class CResponseManager
|
|
{
|
|
public:
|
|
CResponseManager();
|
|
virtual ~CResponseManager();
|
|
|
|
bool NewResponse( /*UINT ip, USHORT port, */ int iExtra, TNETMESSAGE* pResponse );
|
|
TNETMESSAGE * GetResponse( /*UINT ip, USHORT port,*/ TNETMESSAGE* pRequest );
|
|
void OnTimer();
|
|
|
|
private:
|
|
CSema m_smProcess;
|
|
TRESPONSELIST m_lstResponses;
|
|
};
|
|
|
|
|
|
#endif
|