www.pudn.com > net_oss.rar > thread_pool.h


#ifndef __THREAD_POOL_H__
#define __THREAD_POOL_H__

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

using std::cout;
using std::endl;

#define LISTENQ 10
#define Q_ID 0x500
#define ERR_REPORT() { cout << strerror(errno) << endl; exit(-1); }

#define __DEBUG

class thread_pool
{
protected:
		
    int total;
    int mqid;
public:
        thread_pool(int _i = 1, int key = Q_ID);
        virtual ~thread_pool();
        virtual void start(int port) = 0;
public:
	struct info{
			char user_name[50];
			time_t start_time;
			time_t duration;
			char IP[16];
			info() { strcpy(IP,"127.0.0.1"); }
		};
	  struct _mesg{
			long mtype;
			char inf[sizeof(info)];
		};
};

#endif