123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #include "echoclientengine.h"
- #include "tutorial_grpc.qpb.h"
- #include <QGrpcHttp2Channel>
- #include <QGrpcInsecureCredentials>
- using namespace qtprotobuf::tutorial;
- using namespace QtProtobuf;
- EchoClientEngine::EchoClientEngine(QObject *parent) : QObject(parent), m_client(new EchoServiceClient), m_response(new EchoResponse)
- {
- m_client->attachChannel(std::shared_ptr<QAbstractGrpcChannel>(new QGrpcHttp2Channel(QUrl("http://localhost:65000"),
- QGrpcInsecureChannelCredentials()|QGrpcInsecureCallCredentials())));
- }
- void EchoClientEngine::request(qtprotobuf::tutorial::EchoRequest *req)
- {
- m_client->Echo(*req, m_response.get());
- }
|