Development About 1 min read

C++ protocol development

Use explicit ownership and resource limits when working with C++ SDKs. Document callback threads, object lifetimes and error handling in the adapter.

Sources and scopeSource record 25 August 2026

Technical source record: 25 August 2026. Check the linked documentation for current product requirements.

ISO standard text is paywalled; guidance uses public Core Guidelines and vendor requirements

Verification and testing

Overview#

C++ is used for native media pipelines, device SDKs and performance sensitive protocol work. C++23 is the current published ISO C++ standard; use an older language mode only when a vendor SDK/toolchain requires it and record the deviation ISOCPP.

Ownership model#

  • Use RAII wrappers for sockets, files, SDK handles, locks and media buffers.
  • Prefer value types and unique ownership; make shared ownership an explicit concurrency decision.
  • Use spans/views only while the referenced storage lifetime is guaranteed.
  • Express optional/error results without sentinel pointer or magic numeric ambiguity.
  • Keep callback registrations in an object that unregisters before dependent state is destroyed.

Parsing and memory safety#

Validate lengths and checked arithmetic before constructing spans, iterating TLVs or allocating. Avoid reinterpret casting untrusted bytes into structs. Decode explicit widths/endian, bound containers, and keep text encoding explicit. Use string_view only when lifetime is stable.

Media and SDK boundaries#

Record who owns a frame, whether callbacks are synchronous, thread affinity, alignment, pixel/codec format, timestamp domain and how long the memory remains valid. Copy only when necessary, but never retain borrowed SDK memory past its contract. Keep proprietary SDK objects behind an adapter.

Error and shutdown#

Choose a consistent exception/error boundary. Never allow exceptions through C callbacks. Stop new work, cancel/wake blocking I/O, unsubscribe callbacks, join workers, then release downstream handles in a documented order.

Environment assurance#

Apply strict compiler warnings, static analysis, sanitizers, fuzzing against offline parsers, and synthetic lifetime/concurrency cases. Record compiler and standard library versions, ABI, options, fixture corpus, observations, and limitations with the integration evidence.

Sources#