Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
grpc::ClientReaderWriter< W, R > Class Template Reference

#include <channel_interface.h>

Public Member Functions

grpc::Status Finish () override
 
bool NextMessageSize (uint32_t *sz) override
 
bool Read (R *msg) override
 
void WaitForInitialMetadata () override
 
bool Write (const W &msg, grpc::WriteOptions options) override
 
bool WritesDone () override
 

Private Member Functions

 ClientReaderWriter (grpc::ChannelInterface *channel, const grpc::internal::RpcMethod &method, grpc::ClientContext *context)
 

Private Attributes

grpc::internal::Call call_
 
grpc::ClientContextcontext_
 
grpc::CompletionQueue cq_
 

Friends

class internal::ClientReaderWriterFactory< W, R >
 

Detailed Description

template<class W, class R>
class grpc::ClientReaderWriter< W, R >

Synchronous (blocking) client-side API for bi-directional streaming RPCs, where the outgoing message stream coming from the client has messages of type W, and the incoming messages stream coming from the server has messages of type R.

Definition at line 35 of file grpcpp/impl/codegen/channel_interface.h.

Constructor & Destructor Documentation

◆ ClientReaderWriter()

template<class W , class R >
grpc::ClientReaderWriter< W, R >::ClientReaderWriter ( grpc::ChannelInterface channel,
const grpc::internal::RpcMethod method,
grpc::ClientContext context 
)
inlineprivate

Block to create a stream and write the initial metadata and request out. Note that context will be used to fill in custom initial metadata used to send to the server when starting the call.

Definition at line 554 of file grpcpp/impl/codegen/sync_stream.h.

Member Function Documentation

◆ Finish()

template<class W , class R >
grpc::Status grpc::ClientReaderWriter< W, R >::Finish ( )
inlineoverride

See the ClientStreamingInterface.Finish method for semantics.

Side effect:

  • the ClientContext associated with this call is updated with possible trailing metadata sent from the server.

Definition at line 530 of file grpcpp/impl/codegen/sync_stream.h.

◆ NextMessageSize()

template<class W , class R >
bool grpc::ClientReaderWriter< W, R >::NextMessageSize ( uint32_t sz)
inlineoverride

Definition at line 467 of file grpcpp/impl/codegen/sync_stream.h.

◆ Read()

template<class W , class R >
bool grpc::ClientReaderWriter< W, R >::Read ( R *  msg)
inlineoverride

See the ReaderInterface.Read method for semantics. Side effect: Also receives initial metadata if not already received (updates the ClientContext associated with this call in that case).

Definition at line 477 of file grpcpp/impl/codegen/sync_stream.h.

◆ WaitForInitialMetadata()

template<class W , class R >
void grpc::ClientReaderWriter< W, R >::WaitForInitialMetadata ( )
inlineoverride

Block waiting to read initial metadata from the server. This call is optional, but if it is used, it cannot be used concurrently with or after the Finish method.

Once complete, the initial metadata read from the server will be accessible through the ClientContext used to construct this object.

Definition at line 458 of file grpcpp/impl/codegen/sync_stream.h.

◆ Write()

template<class W , class R >
bool grpc::ClientReaderWriter< W, R >::Write ( const W msg,
grpc::WriteOptions  options 
)
inlineoverride

Definition at line 495 of file grpcpp/impl/codegen/sync_stream.h.

◆ WritesDone()

template<class W , class R >
bool grpc::ClientReaderWriter< W, R >::WritesDone ( )
inlineoverride

Definition at line 518 of file grpcpp/impl/codegen/sync_stream.h.

Friends And Related Function Documentation

◆ internal::ClientReaderWriterFactory< W, R >

template<class W , class R >
friend class internal::ClientReaderWriterFactory< W, R >
friend

Definition at line 545 of file grpcpp/impl/codegen/sync_stream.h.

Member Data Documentation

◆ call_

template<class W , class R >
grpc::internal::Call grpc::ClientReaderWriter< W, R >::call_
private

Definition at line 549 of file grpcpp/impl/codegen/sync_stream.h.

◆ context_

template<class W , class R >
grpc::ClientContext* grpc::ClientReaderWriter< W, R >::context_
private

Definition at line 547 of file grpcpp/impl/codegen/sync_stream.h.

◆ cq_

template<class W , class R >
grpc::CompletionQueue grpc::ClientReaderWriter< W, R >::cq_
private

Definition at line 548 of file grpcpp/impl/codegen/sync_stream.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:30