Cleanup protocol/ comments
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* protocol/envelope.h — thin helpers around the generated protobuf types.
|
* protocol/envelope.h: thin helpers around the generated protobuf types.
|
||||||
*
|
*
|
||||||
* Hides the generated namespace from callers that only need to send/receive
|
* Hides the generated namespace from callers that only need to send/receive
|
||||||
* envelopes without touching proto types directly. All callers that do need
|
* envelopes without touching proto types directly. All callers that do need
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace voicecat::protocol {
|
namespace voicecat::protocol {
|
||||||
|
|
||||||
// --- FrameCodec::emit -------------------------------------------------------
|
// FrameCodec::emit
|
||||||
|
|
||||||
void FrameCodec::emit(const uint8_t* payload, size_t len, std::vector<uint8_t>& out) {
|
void FrameCodec::emit(const uint8_t* payload, size_t len, std::vector<uint8_t>& out) {
|
||||||
// Length header: big-endian u32.
|
// Length header: big-endian u32.
|
||||||
@@ -20,7 +20,7 @@ void FrameCodec::emit(const std::vector<uint8_t>& payload, std::vector<uint8_t>&
|
|||||||
emit(payload.data(), payload.size(), out);
|
emit(payload.data(), payload.size(), out);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- FrameCodec::feed -------------------------------------------------------
|
// FrameCodec::feed
|
||||||
|
|
||||||
bool FrameCodec::feed(const uint8_t* data, size_t len,
|
bool FrameCodec::feed(const uint8_t* data, size_t len,
|
||||||
std::vector<std::vector<uint8_t>>& out_frames) {
|
std::vector<std::vector<uint8_t>>& out_frames) {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* protocol/protocol.h — control-plane (de)serialization + routing.
|
* protocol/protocol.h: control-plane (de)serialization + routing.
|
||||||
*
|
*
|
||||||
* Design: docs/protocol.md. Wire format is a length-prefixed protobuf `Envelope`
|
* Wire format is a length-prefixed protobuf `Envelope`
|
||||||
* (core/proto/voicecat.proto). This layer parses frames into Envelopes, correlates
|
* (core/proto/voicecat.proto). This layer parses frames into Envelopes, correlates
|
||||||
* request_id ↔ response, and dispatches to handlers. Media frames do NOT come through here
|
* request_id response, and dispatches to handlers. Media frames do NOT come through here
|
||||||
* (they use the fixed binary header in voice.md §2).
|
* (they use the fixed binary header
|
||||||
*
|
*
|
||||||
* FrameCodec below is used by both the client (net/transport.h) and the server
|
* FrameCodec below is used by both the client (net/transport.h) and the server
|
||||||
* (conn_session.cpp). See protocol/envelope.h for the Envelope-level encode/decode that sits
|
* (conn_session.cpp). See protocol/envelope.h for the Envelope-level encode/decode that sits
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
namespace voicecat::protocol {
|
namespace voicecat::protocol {
|
||||||
|
|
||||||
constexpr uint32_t kProtocolVersion = 1;
|
constexpr uint32_t kProtocolVersion = 1;
|
||||||
constexpr uint32_t kMaxFrameBytes = 16u * 1024 * 1024; // docs/protocol.md §1 guard
|
constexpr uint32_t kMaxFrameBytes = 16u * 1024 * 1024;
|
||||||
constexpr size_t kLengthHeaderSize = 4; // big-endian u32 prefix
|
constexpr size_t kLengthHeaderSize = 4; // big-endian u32 prefix
|
||||||
|
|
||||||
// Reads/writes [u32 big-endian length][payload] frames from a byte stream.
|
// Reads/writes [u32 big-endian length][payload] frames from a byte stream.
|
||||||
|
|||||||
Reference in New Issue
Block a user