Skip to content
Tagged articles

unpack

2 articles · Page 1 of 1
Architecture Pony
Architecture Pony
Nov 9, 2026 · Backend Development

Netty Framing Deep Dive: LengthFieldBasedFrameDecoder, TCP Stick/Unpack, and Protocol Pitfalls

This article analyzes three real-world Netty framing failures — half-pack JSON parsing, fixed-length decoder misalignment, and unbounded length-field OOM — then explains TCP's lack of message boundaries, compares three framing strategies, details LengthFieldBasedFrameDecoder's five parameters with diagrams, walks through ByteToMessageDecoder's cumulation and callDecode loop, shows Dubbo/gRPC protocol headers, and lists eight common codec pitfalls with fixes.

Netty Framing Deep Dive: LengthFieldBasedFrameDecoder, TCP Stick/Unpack, and Protocol Pitfalls
21CTO
21CTO
Sep 22, 2015 · Backend Development

How to Integrate Protocol Buffers with PHP over Binary TCP Sockets

This article explains how to add Protocol Buffer communication to a PHP web system, covering library setup, proto file adjustments, code generation, binary TCP handling with pack/unpack, and the switch from read_line to fread for reliable socket reads.

How to Integrate Protocol Buffers with PHP over Binary TCP Sockets