mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-04 21:09:19 +08:00
929ebc13be
增加了 master_dispatch 服务模板,由其接收外来客户端连接,同时将连接平均分配给后端的服务子进程
24 lines
372 B
C++
24 lines
372 B
C++
#pragma once
|
|
#include <vector>
|
|
|
|
class ServerConnection;
|
|
|
|
class ServerManager : public acl::singleton <ServerManager>
|
|
{
|
|
public:
|
|
ServerManager() {}
|
|
~ServerManager() {}
|
|
|
|
void set(ServerConnection* conn);
|
|
void del(ServerConnection* conn);
|
|
ServerConnection* min();
|
|
|
|
size_t length() const
|
|
{
|
|
return conns_.size();
|
|
}
|
|
|
|
private:
|
|
std::vector<ServerConnection*> conns_;
|
|
};
|