Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. Comms
  5. pw_rpc
  6. pw::rpc::Rpc2AdapterConfig Struct Reference
pw::rpc::Rpc2AdapterConfig Struct Reference

Overview

Configuration for Rpc2Adapter and Rpc2ServerAdapter.

Public Attributes

uint32_t first_channel_id = 100
 
uint16_t max_channels = 0
 
uint16_t max_queued_messages_per_call = 8
 

Member Data Documentation

◆ first_channel_id

uint32_t pw::rpc::Rpc2AdapterConfig::first_channel_id = 100

Lowest channel ID the adapter assigns to pw_rpc2 connections. Must be larger than a project's own channel IDs and must not be 0. Defaults to 100.

New IDs are assigned sequentially upward from first_channel_id. IDs already open on the server are skipped. Closed connections' channels remain open, but are reused before allocating new IDs.

ID assignments never wrap past UINT32_MAX, so set first_channel_id above your project's largest channel ID, but leave room below UINT32_MAX for peak concurrent pw_rpc2 connections.

◆ max_channels

uint16_t pw::rpc::Rpc2AdapterConfig::max_channels = 0

Maximum number of channels the adapter keeps open on the server at once, or 0 for no limit other than the server's free channel slots.

◆ max_queued_messages_per_call

uint16_t pw::rpc::Rpc2AdapterConfig::max_queued_messages_per_call = 8

Maximum outgoing stream messages to buffer per call before writes fail (must not be 0). Defaults to 8 so handlers can write a short burst without waiting while bounding the memory a stalled call can hold.


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