Ai
1 Star 0 Fork 0

wangcichen/urbackup_backend

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ServiceAcceptor.h 908 Bytes
一键复制 编辑 原始数据 按行查看 历史
Martin Raiber 提交于 2019-06-24 20:05 +08:00 . Make ipv6 optional per default
#include <vector>
#include <string>
#include "socket_header.h"
#include "Interface/Thread.h"
#include "Interface/Pipe.h"
#include "Server.h"
class CServiceWorker;
class IService;
class CServiceAcceptor : public IThread
{
public:
CServiceAcceptor(IService * pService, std::string pName, unsigned short port, int pMaxClientsPerThread, IServer::BindTarget bindTarget);
~CServiceAcceptor();
void operator()(void);
private:
void AddToWorker(SOCKET pSocket, const std::string& endpoint);
bool init_socket_v4(unsigned short port, IServer::BindTarget bindTarget);
bool init_socket_v6(unsigned short port, IServer::BindTarget bindTarget);
std::vector<CServiceWorker*> workers;
SOCKET s;
SOCKET s_v6;
std::string name;
IService * service;
IPipe *exitpipe;
#ifndef _WIN32
int xpipe[2];
#endif
bool do_exit;
bool has_error;
int maxClientsPerThread;
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/wangcichen/urbackup_backend.git
git@gitee.com:wangcichen/urbackup_backend.git
wangcichen
urbackup_backend
urbackup_backend
dev

搜索帮助