forked from artyom-beilis/cppcms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtcp_connector.h
41 lines (31 loc) · 1.07 KB
/
tcp_connector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <[email protected]>
//
// See accompanying file COPYING.TXT file for licensing details.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef CPPCMS_TCP_CONNECTOR_H
#define CPPCMS_TCP_CONNECTOR_H
#include <string>
#include <vector>
#include <booster/noncopyable.h>
namespace cppcms {
namespace impl {
class messenger;
struct tcp_operation_header;
class tcp_connector : private booster::noncopyable
{
public:
messenger &get(std::string const &key);
tcp_connector(std::vector<std::string> const &ip_list,std::vector<int> const &port_list);
virtual ~tcp_connector();
void broadcast(tcp_operation_header &h,std::string &data);
protected:
messenger *tcp;
int conns;
virtual unsigned hash(std::string const &key);
};
} // impl
} // cppcms
#endif