tinyrpc/includes/net/tinypb/tinypb_channel.hpp
2025-02-05 20:50:31 +08:00

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;
};
}