liuxiaolong
2021-07-20 58d904a328c0d849769b483e901a0be9426b8209
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
42
/*
 * =====================================================================================
 *
 *       Filename:  tcp_proxy.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2021年05月19日 15时04分55秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Li Chao (), lichao@aiotlink.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef TCP_PROXY_E1YJ92U5
#define TCP_PROXY_E1YJ92U5
 
#include "bh_util.h"
#include "io_service.h"
#include "tcp_common.h"
#include <memory>
 
class NodeCenter;
typedef std::shared_ptr<Synced<NodeCenter>> CenterPtr;
 
class TcpProxy
{
public:
    typedef IoService::io_service_t io_service_t;
    TcpProxy(io_service_t &io) :
        io_(io) {}
    bool Request(const std::string &ip, int port, std::string &&content, ReplyCB const &cb);
    bool Publish(const std::string &ip, int port, std::string &&content);
 
private:
    io_service_t &io_;
};
 
#endif // end of include guard: TCP_PROXY_E1YJ92U5