Core Concepts

Purpose

Deep dive into the internal architecture and design decisions of Rcon.

Topics

Architecture

Rcon follows a layered architecture with clear separation of concerns:

  1. High-Level API (RconClient) - User-friendly interface with logging

  2. Core API (Rcon) - Thread-safe protocol implementation

  3. I/O Layer (PacketReader/PacketWriter) - Socket operations

  4. Codec Layer (PacketCodec) - Binary encoding/decoding

  5. Domain Model (Packet) - Immutable packet representation

Each layer has a single responsibility and can be used independently if needed.

Design Principles

  • Zero Dependencies - Pure Java standard library

  • Immutability - Packet objects are immutable

  • Thread Safety - Safe concurrent access via synchronized methods

  • Separation of Concerns - Clear layer boundaries

  • Configurability - Pluggable strategies and options

Performance Characteristics

  • Minimal Allocation - Buffers are reused via compact()

  • Lock-Free Counter - AtomicInteger for request IDs

  • Efficient Encoding - Direct buffer manipulation

  • Smart Fragment Resolution - Default strategy minimizes round-trips


Table of contents


This site uses Just the Docs, a documentation theme for Jekyll.