23 lines
581 B
C++
23 lines
581 B
C++
#pragma once
|
|
|
|
#include "net_address.hpp"
|
|
#include "tcp_client.hpp"
|
|
#include <google/protobuf/service.h>
|
|
|
|
namespace tinyrpc {
|
|
|
|
class TinypbChannel : public google::protobuf::RpcChannel {
|
|
public:
|
|
TinypbChannel(const NetAddress& peerAddr);
|
|
~TinypbChannel() = default;
|
|
void CallMethod(const google::protobuf::MethodDescriptor* method,
|
|
google::protobuf::RpcController* controller,
|
|
const google::protobuf::Message* request,
|
|
google::protobuf::Message* response,
|
|
google::protobuf::Closure* done) override;
|
|
|
|
private:
|
|
TcpClient m_client;
|
|
};
|
|
|
|
} |