📄 socketthread.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 + -