# aceld/zinx

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/aceld-zinx).**

7,730 stars · 1,263 forks · Go · MIT

## Links

- GitHub: https://github.com/aceld/zinx
- Homepage: https://github.com/aceld/zinx/wiki
- awesome-repositories: https://awesome-repositories.com/repository/aceld-zinx.md

## Topics

`game-server` `go` `golang` `tcp-server` `zinx`

## Description

Zinx is a lightweight TCP server framework written in Go that provides a structured foundation for building scalable network applications. It combines a goroutine-pool worker model for concurrency control with message-ID-based routing, enabling efficient packet dispatching to registered handler functions.

The framework distinguishes itself through its modular plugin architecture, which organizes server components like routers, connections, and message modules as interchangeable plugins for extensibility. It uses packet-header length prefixing for reliable TCP stream framing, assigns a dedicated reader goroutine per connection for non-blocking I/O, and loads server parameters from a JSON configuration file at startup.

Zinx supports concurrent connection management, TCP client connections, and message routing by numeric identifier, providing the core building blocks for constructing TCP servers with controlled concurrency and modular design.

## Tags

### Networking & Communication

- [Asynchronous TCP Frameworks](https://awesome-repositories.com/f/networking-communication/tcp-protocol-implementations/asynchronous-tcp-frameworks.md) — Provides a lightweight, modular framework for building TCP servers in Go with connection handling and message routing. ([source](https://cdn.jsdelivr.net/gh/aceld/zinx@master/README.md))
- [Numeric Identifier Dispatch](https://awesome-repositories.com/f/networking-communication/message-routing/numeric-identifier-dispatch.md) — Dispatches incoming data to registered handler functions based on a numeric message identifier. ([source](https://cdn.jsdelivr.net/gh/aceld/zinx@master/README.md))
- [TCP Client Connections](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/tcp-client-connections.md) — Establishes TCP connections to remote servers and sends messages with a specified message ID. ([source](https://cdn.jsdelivr.net/gh/aceld/zinx@master/README.md))

### Data & Databases

- [Length-Delimited Encodings](https://awesome-repositories.com/f/data-databases/data-serialization-formats/binary-serialization-protocols/length-delimited-encodings.md) — Encodes message length and ID in a fixed-size header for reliable packet framing over TCP streams.

### Programming Languages & Runtimes

- [Fixed-Size Pools](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/task-orchestration-frameworks/thread-pools/goroutine-pools/fixed-size-pools.md) — Provides a fixed goroutine pool for handling client requests, controlling concurrency in the TCP server.

### Security & Cryptography

- [Concurrent Connection Handling](https://awesome-repositories.com/f/security-cryptography/authorization-policies/throughput-scaling/concurrent-connection-handling.md) — Manages multiple TCP client connections concurrently in a Go server with efficient resource usage.

### Software Engineering & Architecture

- [Goroutine-Per-Connection Models](https://awesome-repositories.com/f/software-engineering-architecture/thread-per-connection-models/goroutine-per-connection-models.md) — Assigns a dedicated goroutine per TCP connection for continuous packet reading and non-blocking I/O.
- [Numeric Message Identifiers](https://awesome-repositories.com/f/software-engineering-architecture/type-based-message-routing/numeric-message-identifiers.md) — Routes incoming packets to handler functions based on a numeric message identifier in the packet header.
- [JSON-Driven Configuration Schemas](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/configuration-formats/json-driven-configuration-schemas.md) — Loads server parameters from a JSON configuration file at startup, enabling runtime behavior changes.
- [Plugin-Based Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures/plugin-based-architectures.md) — Organizes server components as interchangeable plugins, supporting extensibility and custom implementations.

### Web Development

- [JSON Configuration Files](https://awesome-repositories.com/f/web-development/single-page-applications/single-file-distributions/json-configuration-files.md) — Reads server settings such as port, max connections, and log behavior from a JSON configuration file. ([source](https://cdn.jsdelivr.net/gh/aceld/zinx@master/README.md))

### Part of an Awesome List

- [Concurrency and Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/concurrency-and-utilities.md) — A framework for building high-concurrency TCP servers.
