/*
|
* =====================================================================================
|
*
|
* 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
|