This hand-rolled marshal/send/receive loop is exactly the problem gRPC and Protocol Buffers were built to solve at Google scale, and the raw-struct approach shown here is precisely why real RPC systems must worry about endianness and struct-padding mismatches between client and server architectures. The partial-read/partial-write handling this task calls out is a genuine correctness requirement: naive single `recv()` calls assuming a full struct arrives atomically are a well-known source of intermittent bugs over real TCP connections, where the OS is free to deliver data in fragments.