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

Overview

Configuration for in-memory forwarding sockets (ForwardingSocketPair and ForwardingTransport).

Public Attributes

uint16_t queue_depth = 1
 
size_t max_message_size_bytes = kDefaultMaxMessageSizeBytes
 

Static Public Attributes

static constexpr size_t kDefaultMaxMessageSizeBytes = 1500
 

Member Data Documentation

◆ kDefaultMaxMessageSizeBytes

constexpr size_t pw::transport::ForwardingSocketOptions::kDefaultMaxMessageSizeBytes = 1500
staticconstexpr

Default for max_message_size_bytes. Matches the 1500-byte Ethernet MTU, so a default socket behaves like a typical network link and bounds the size of each write buffer allocation.

◆ max_message_size_bytes

size_t pw::transport::ForwardingSocketOptions::max_message_size_bytes = kDefaultMaxMessageSizeBytes

The largest message that can be sent or received, in bytes. Sets both max_write_message_size_bytes() and max_read_message_size_bytes() on each socket.

◆ queue_depth

uint16_t pw::transport::ForwardingSocketOptions::queue_depth = 1

The maximum number of active write reservations plus unread datagrams allowed in each direction at once. Must be at least 1.

When a socket has queue_depth active write reservations and unread datagrams queued on its peer, TryReserveWrite returns std::nullopt and ReserveWrite waits until the peer reads a datagram or an active reservation is committed or canceled.


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