⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 socketthread.h

📁 线程池+socket
💻 H
字号:
#ifndef SOCKETTHREAD_H
#define SOCKETTHREAD_H

#include <sys/socket.h>
#include <sys/types.h>
#include "Thread.h"
#include "ThreadPool.h"
class CSocketBase;

class CSocketThread : public CThread
{
public:
	CSocketThread();
	virtual ~CSocketThread();
		
public:
	void		SocketThread();
	//线程运行的接口
	void virtual 	Run();
	//添加新任务
	void		SetNewSocket(CSocketBase *pSocket);
	void		SetThreadPool(CThreadPool *pThreadPool) {m_pThreadPool = pThreadPool;}
	CSocketBase	*GetSocket() const {return m_pSocket;}
	void		SetIdleThList(t_IdleThList *pIdleThList) { m_pIdleThList = pIdleThList; }
	void		SetBusyThList(t_BusyThList *pBusyThList) {m_pBusyThList = pBusyThList;}
	
private:
	CSocketBase	*m_pSocket;
	CThreadPool	*m_pThreadPool;
	t_IdleThList	*m_pIdleThList;
	t_BusyThList	*m_pBusyThList;
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -