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

#include <sync_stream.h>

Inheritance diagram for grpc::ServerReaderWriter< W, R >:
Inheritance graph
[legend]

Public Member Functions

bool NextMessageSize (uint32_t *sz) override
 
bool Read (R *msg) override
 
void SendInitialMetadata () override
 
bool Write (const W &msg, grpc::WriteOptions options) override
 
- Public Member Functions inherited from grpc::internal::ServerStreamingInterface
virtual ~ServerStreamingInterface ()
 
- Public Member Functions inherited from grpc::internal::WriterInterface< W >
bool Write (const W &msg)
 
void WriteLast (const W &msg, grpc::WriteOptions options)
 
virtual ~WriterInterface ()
 
- Public Member Functions inherited from grpc::internal::ReaderInterface< R >
virtual ~ReaderInterface ()
 

Private Member Functions

 ServerReaderWriter (grpc::internal::Call *call, grpc::ServerContext *ctx)
 

Private Attributes

internal::ServerReaderWriterBody< W, R > body_
 

Friends

class internal::TemplatedBidiStreamingHandler< ServerReaderWriter< W, R >, false >
 

Detailed Description

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

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

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

Constructor & Destructor Documentation

◆ ServerReaderWriter()

template<class W , class R >
grpc::ServerReaderWriter< W, R >::ServerReaderWriter ( grpc::internal::Call call,
grpc::ServerContext ctx 
)
inlineprivate

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

Member Function Documentation

◆ NextMessageSize()

template<class W , class R >
bool grpc::ServerReaderWriter< W, R >::NextMessageSize ( uint32_t sz)
inlineoverridevirtual

Get an upper bound on the next message size available for reading on this stream.

Implements grpc::internal::ReaderInterface< R >.

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

◆ Read()

template<class W , class R >
bool grpc::ServerReaderWriter< W, R >::Read ( R *  msg)
inlineoverridevirtual

Block to read a message and parse to msg. Returns true on success. This is thread-safe with respect to Write or \WritesDone methods on the same stream. It should not be called concurrently with another Read on the same stream as the order of delivery will not be defined.

Parameters
[out]msgThe read message.
Returns
false when there will be no more incoming messages, either because the other side has called WritesDone() or the stream has failed (or been cancelled).

Implements grpc::internal::ReaderInterface< R >.

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

◆ SendInitialMetadata()

template<class W , class R >
void grpc::ServerReaderWriter< W, R >::SendInitialMetadata ( )
inlineoverridevirtual

See the ServerStreamingInterface.SendInitialMetadata method for semantics. Note that initial metadata will be affected by the ServerContext associated with this call.

Implements grpc::internal::ServerStreamingInterface.

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

◆ Write()

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

Block to write msg to the stream with WriteOptions options. This is thread-safe with respect to ReaderInterface::Read

Parameters
msgThe message to be written to the stream.
optionsThe WriteOptions affecting the write operation.
Returns
true on success, false when the stream has been closed.

Implements grpc::internal::WriterInterface< W >.

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

Friends And Related Function Documentation

◆ internal::TemplatedBidiStreamingHandler< ServerReaderWriter< W, R >, false >

template<class W , class R >
friend class internal::TemplatedBidiStreamingHandler< ServerReaderWriter< W, R >, false >
friend

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

Member Data Documentation

◆ body_

template<class W , class R >
internal::ServerReaderWriterBody<W, R> grpc::ServerReaderWriter< W, R >::body_
private

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


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


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