QGrpcBidiStream Class | Qt GRPC | Qt 6.11.2
Description: The QGrpcBidiStream class provides access in handling bidirectional-streaming RPCs.

- Qt 6.11
- Qt GRPC
- C++ Classes
- QGrpcBidiStream
- Qt 6.11.2 Reference Documentation

# QGrpcBidiStream Class

The QGrpcBidiStream class provides access in handling bidirectional-streaming RPCs. More...

Header: | `#include <QGrpcBidiStream>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Grpc)` `target_link_libraries(mytarget PRIVATE Qt6::Grpc)`
Since: | Qt 6.7
Inherits: | QGrpcOperation

- List of all members, including inherited members

## Public Functions

virtual | ~QGrpcBidiStream() override
void | writeMessage(const QProtobufMessage &message)
`(since 6.8)` void | writesDone()

## Signals

void | messageReceived()

## Detailed Description

The QGrpcBidiStream class provides the interface for handling bidirectional-streaming remote procedure calls (RPCs), which is one of the four gRPC™ service methods.

For a high-level overview, refer to the Qt GRPC Client Guide.

Note: Users are responsible for managing the unique RPC handlers returned by the `Client` interface, ensuring their existence at least until the finished signal is emitted. After receiving this signal, the handler can be safely reassigned or destroyed.

## Member Function Documentation

### `[override virtual noexcept]` QGrpcBidiStream::~QGrpcBidiStream()

Destroys the QGrpcBidiStream.

### `[signal]` void QGrpcBidiStream::messageReceived()

This signal is emitted when the streaming RPC has received a new message from the server. The read() methods can then be used to deserialize the received message.

### void QGrpcBidiStream::writeMessage(const QProtobufMessage &message)

Serializes message and sends it to the server.

### `[since 6.8]` void QGrpcBidiStream::writesDone()

Ends the stream from the client side (half-closing). The server is still allowed to send responses after this call.

This function was introduced in Qt 6.8.