socketthread.h
来自「线程池+socket」· C头文件 代码 · 共 35 行
H
35 行
#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 + =
减小字号Ctrl + -
显示快捷键?