/******************************************************************************
文件名 : RecvThreadPool.h
版本号 : 初稿
作 者 : lieyingshengbao
生成日期 : 2012-9-22
最近修改 :
功能描述 : 收到消息后真正处理过程
函数列表 :
******************************************************************************/
#ifndef RECVTHREADPOOL_H
#define RECVTHREADPOOL_H
#include "stdafx.h"
#include "ProcThreadPool.h"
const int RECVTHREADNUM = 5; //接收线程个数
const int PROCTHREADNUM = 5; //处理线程个数
const short PORT = 9876;
class RecvThreadPool
:public ThreadPool<SOCKET>
{
public:
RecvThreadPool()
{
m_bServerRun = false; //关闭监听线程的标志
}
~RecvThreadPool(){}
int CreateListenThread();
void StartProcPool(int nNum)
{
m_ProThreadPool.SetThreadNum(nNum);
m_ProThreadPool.Run();
}
void TerminateProcAll()
{
m_ProThreadPool.TerminateAll();
}
private:
void ProcessFun(SOCKET* pSock);
u_int GetMsgLen(BYTE cArryMsgLen[]);
int RecvTotalMsg();
static unsigned __stdcall ListenThread(LPVOID Param);
public:
bool m_bServerRun;
private:
ProcThreadPool m_ProThreadPool;
};
#endif