The QGrpcHttp2Channel class is HTTP/2 implementation of QAbstractGrpcChannel interface. More...
#include <qgrpchttp2channel.h>
Public Member Functions | |
QGrpcHttp2Channel (const QUrl &url, std::unique_ptr< QAbstractGrpcCredentials > credentials) | |
QGrpcHttp2Channel constructs QGrpcHttp2Channel. More... | |
QGrpcStatus | call (const QString &method, const QString &service, const QByteArray &args, QByteArray &ret) override |
Calls method synchronously with given serialized message args and write result of call to ret . More... | |
void | call (const QString &method, const QString &service, const QByteArray &args, QtProtobuf::QGrpcAsyncReply *reply) override |
Calls method asynchronously with given serialized messge args . More... | |
void | subscribe (QGrpcSubscription *subscription, const QString &service, QAbstractGrpcClient *client) override |
Subscribes to server-side stream to receive updates for given method . More... | |
std::shared_ptr< QAbstractProtobufSerializer > | serializer () const override |
Public Member Functions inherited from QtProtobuf::QAbstractGrpcChannel | |
const QThread * | thread () const |
The QGrpcHttp2Channel class is HTTP/2 implementation of QAbstractGrpcChannel interface.
For QGrpcHttp2Channel utilizes channel and call credentials. For channel credential QGrpcHttp2Channel supports SslConfigCredential key. When https is used, this key has to be explicitly specified and provide QSslConfiguration and value. Provided QSslConfiguration will be used to establish HTTP/2 secured connection. All keys passed as QGrpcCallCredentials will be used as HTTP/2 headers with related values assigned.
QGrpcHttp2Channel::QGrpcHttp2Channel | ( | const QUrl & | url, |
std::unique_ptr< QAbstractGrpcCredentials > | credentials | ||
) |
QGrpcHttp2Channel constructs QGrpcHttp2Channel.
url | http/https url used to establish channel connection |
credentials | call/channel credentials pair |
|
overridevirtual |
Calls method
synchronously with given serialized message args
and write result of call to ret
.
[in] | method | remote method is called |
[in] | service | service identified in URL path format |
[in] | args | serialized argument message |
[out] | ret | output bytearray to collect returned message |
Implements QtProtobuf::QAbstractGrpcChannel.
|
overridevirtual |
Calls method
asynchronously with given serialized messge args
.
Result of method call is written to QGrpcAsyncReply.
[in] | method | remote method is called |
[in] | service | service identified in URL path format |
[in] | args | serialized argument message |
[out] | ret | QGrpcAsyncReply that will be returned to end-point user to read data once call complete. QGrpcAsyncReply lifecycle is managed by QAbstractGrpcClient only. |
Implements QtProtobuf::QAbstractGrpcChannel.
|
overridevirtual |
Subscribes to server-side stream to receive updates for given method
.
[in] | method | remote method is called |
[in] | service | service identified in URL path format |
[in] | args | serialized argument message |
[in] | handler | callback that will be called when message recevied from the server-stream |
Implements QtProtobuf::QAbstractGrpcChannel.