a8/a8/tcpsessionpool.h
2018-08-26 20:34:01 +08:00

30 lines
554 B
C++

#ifndef A8_TCPSESSONPOLL_HPP
#define A8_TCPSESSONPOLL_HPP
namespace a8
{
class TcpSession;
class TcpSessionPool
{
struct TcpSessionNode;
public:
TcpSessionPool();
~TcpSessionPool();
void Add(a8::TcpSession* session);
a8::TcpSession* Get();
int Count();
private:
void ClearTimeOutSocket();
private:
a8::TcpSessionPool::TcpSessionNode* top_node_ = nullptr;
a8::TcpSessionPool::TcpSessionNode* bot_node_ = nullptr;
int count_ = 0;
};
}
#endif