IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QGrpcHttp2Channel Class

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

This class was introduced in Qt 6.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QGrpcHttp2Channel Class

  • Header: QGrpcHttp2Channel

  • Since: Qt 6.5

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Grpc)

    target_link_libraries(mytarget PRIVATE Qt6::Grpc)

  • Inherits: QAbstractGrpcChannel

Detailed Description

Uses QGrpcChannelOptions and QGrpcCallOptions to control the HTTP/2 communication with the server.

Use QGrpcChannelOptions to set the SSL configuration, application-specific HTTP/2 headers, and connection timeouts.

QGrpcCallOptions control channel parameters for the specific unary call or gRPC stream.

See Also

Member Function Documentation

 

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

Constructs QGrpcHttp2Channel with options.

[override virtual] 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.

[override virtual] std::shared_ptr<QGrpcCallReply> QGrpcHttp2Channel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, const QGrpcCallOptions &options = QGrpcCallOptions())

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

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.

[override virtual] std::shared_ptr<QAbstractProtobufSerializer> QGrpcHttp2Channel::serializer() const

Reimplements: QAbstractGrpcChannel::serializer() const.

Returns the newly created QProtobufSerializer shared pointer.

[override virtual] std::shared_ptr<QGrpcStream> QGrpcHttp2Channel::startStream(QLatin1StringView method, QLatin1StringView service, QByteArrayView arg, const QGrpcCallOptions &options = QGrpcCallOptions())

Reimplements: QAbstractGrpcChannel::startStream(QLatin1StringView method, QLatin1StringView service, QByteArrayView arg, const QGrpcCallOptions &options).

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.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+