QGrpcHttp2Channel Class

The QGrpcHttp2Channel class is an HTTP/2 implementation of QAbstractGrpcChannel interface. More...

Header: #include <QGrpcHttp2Channel>
Inherits: QAbstractGrpcChannel

Public Functions

QGrpcHttp2Channel(const QGrpcChannelOptions &options)
virtual ~QGrpcHttp2Channel() override
int call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, const QGrpcCallOptions &options = QGrpcCallOptions()) override
int serializer() const override
int startStream(QLatin1StringView method, QLatin1StringView service, QByteArrayView arg, const QGrpcCallOptions &options = QGrpcCallOptions()) override

Reimplemented Public Functions

virtual QGrpcStatus call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret, const QGrpcCallOptions &options = QGrpcCallOptions()) override

Detailed Description

\inmoduleQtGrpc

QGrpcHttp2Channel utilizes channel and call credentials. Channel credential QGrpcHttp2Channel supports SslConfigCredential key. When HTTPS is used, this key has to be explicitly specified and provide QSslConfiguration and value. The QSslConfiguration provided 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.

Member Function Documentation

[explicit] QGrpcHttp2Channel::QGrpcHttp2Channel(const QGrpcChannelOptions &options)

QGrpcHttp2Channel constructs QGrpcHttp2Channel with options.

[override virtual noexcept] QGrpcHttp2Channel::~QGrpcHttp2Channel()

Destroys the QGrpcHttp2Channel object.

[override virtual] QGrpcStatus QGrpcHttp2Channel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret, const QGrpcCallOptions &options = QGrpcCallOptions())

Reimplements: QAbstractGrpcChannel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret, const QGrpcCallOptions &options).

Synchronously calls the RPC method and writes the result to the output parameter ret.

The RPC method name is constructed by concatenating the method and service parameters and called with the args argument. Uses options argument to set additional parameter for the call.

int QGrpcHttp2Channel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, const QGrpcCallOptions &options = QGrpcCallOptions())

Asynchronously calls the RPC method.

The RPC method name is constructed by concatenating the method and service parameters and called with the args argument. Uses options argument to set additional parameter for the call. The method can emit QGrpcCallReply::finished() and QGrpcCallReply::errorOccurred() signals on a QGrpcCallReply returned object.

int QGrpcHttp2Channel::serializer() const

Returns the newly created QProtobufSerializer shared pointer.

int QGrpcHttp2Channel::startStream(QLatin1StringView method, QLatin1StringView service, QByteArrayView arg, const QGrpcCallOptions &options = QGrpcCallOptions())

Creates and starts a stream to the RPC method.

The RPC method name is constructed by concatenating the method and service parameters and called with the arg argument. Returns a shared pointer to the QGrpcStream. Uses options argument to set additional parameter for the stream.

Calls QGrpcStream::updateData() when the stream receives data from the server. The method may emit QGrpcStream::errorOccurred() when the stream has terminated with an error.