Sends streamed pw_protobuf responses for a server streaming RPC on a server.
| Response | The generated pw_protobuf response message struct type. |
Public Member Functions | |
| constexpr | PwpbServerWriter ()=default |
Creates an inactive PwpbServerWriter into which an active call can be moved. | |
| PwpbServerWriter (PwpbServerWriter &&)=default | |
| PwpbServerWriter & | operator= (PwpbServerWriter &&)=default |
| Status | Write (const Response &response) |
Encodes and sends a streamed Response message to the client. | |
| Status | Finish (Status status=OkStatus()) |
| Closes the RPC and sends the final status to the client. | |
| Status | TryFinish (Status status=OkStatus()) |
| Attempts to close the RPC and send the final status to the client. | |
Static Public Member Functions | |
| template<auto kMethod, typename ServiceImpl > | |
| static PwpbServerWriter | Open (Server &server, uint32_t channel_id, ServiceImpl &service) |
Creates a PwpbServerWriter that is ready to send responses for a particular RPC. | |
Friends | |
| class | internal::Call |
| class | internal::PwpbMethod |
| class | Server |
| template<typename , typename , uint32_t > | |
| class | internal::test::InvocationContext |
|
inline |
Closes the RPC and sends the final status to the client.
| [in] | status | The overall status of the RPC to send to the client. |
ChannelOutput implementation if sending the packet failed.
|
inlinestatic |
Creates a PwpbServerWriter that is ready to send responses for a particular RPC.
This can be used for testing or to send responses to an RPC that has not been started by a client.
| kMethod | Pointer to the generated service method. |
| ServiceImpl | The service implementation class. |
| [in,out] | server | The RPC Server on which to open the call. |
| [in] | channel_id | The ID of the channel on which to send responses. |
| [in,out] | service | The registered service instance handling the RPC. |
PwpbServerWriter bound to the specified channel and method.
|
inline |
Attempts to close the RPC and send the final status to the client.
Unlike Finish(), the call remains open if sending the final packet fails, allowing the caller to retry.
| [in] | status | The overall status of the RPC to send to the client. |
ChannelOutput implementation if sending the packet failed (the call remains active).
|
inline |
Encodes and sends a streamed Response message to the client.
| [in] | response | The Response message struct to encode and send. |
pw_rpc was unable to encode the pw_protobuf message.ChannelOutput implementation if sending the packet failed.