Urgent.News

the world's headlines, one feed

Tech

Building a Leak-Safe gRPC Frame Decoder on Reactor Netty

This is the second article in my grpc-reactor series. The first article explains why I chose to build the runtime directly on Reactor Netty and where its compatibility boundary sits. This article moves one layer down into the Stage 1 protocol implementation: the frame decoder that every RPC shape relies on. gRPC protobuf messages are not written directly as raw bytes into HTTP/2 DATA frames.…

This article is the second installment in a series exploring the implementation of a gRPC runtime on Reactor Netty. The focus of this article is on the Stage 1 protocol implementation, specifically the frame decoder that is utilized by every RPC shape. gRPC protobuf messages are not transmitted as raw bytes within HTTP/2 DATA frames.

Instead, each message is prefixed with a five-byte envelope. The first byte's least significant bit encodes whether compression is applied, while the next seven bits must be zero. Bytes 1 through 4 represent an unsigned big-endian payload length. Bytes 5 to n contain either the protobuf message itself or its compressed representation.

Decoding this envelope presents a challenge, as it does not assume that each input buffer will contain a complete frame. This is due to the fact that HTTP/2, TCP, and Reactor Netty do not guarantee that buffer boundaries will align with gRPC message boundaries.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written; read the original for the full account.

Read the original at dev.to →

More in Tech

Docker for Beginners: Images, Containers, Ports, and Volumes Explained

Docker for Beginners: Images, Containers, Ports, and Volumes Explained If you've ever followed a programming tutorial and seen something like: docker run ...

  • Docker images are read-only templates for creating containers
  • Containers are running instances of Docker images
  • Port mapping allows external access to container ports

I Tried Building JavaScript Games Without a Game Engine. Here's What I Learned

I am a digital marketer, not a professional developer or game developer. Most of my career has been focused on SEO, growth marketing, paid acquisition, content, and digital strategy.

  • Simple HTML, CSS, and JavaScript can build many browser games.
  • JavaScript event system crucial for handling user actions.
  • HTML elements often sufficient for games without canvas technology.