cellnet: A Componentized Go Network Library for Game Servers and Embedded Systems
High performance, simple, extensible golang open source network library
At a glance
- What is it?
- davyxu/cellnet is a Go network library designed for game server development, with support for TCP, UDP, HTTP, and WebSocket transports alongside four interchangeable codec formats. Its queue-based message dispatch separates network I/O from business logic, letting developers choose between single-threaded async, multi-threaded sync, and fully concurrent processing models within a single application.
- Who is it for?
- cellnet is a practical choice for Go game server development that requires mixing multiple codec formats or running different message-processing models in the same server process. Its layered Peer/Processor/Codec architecture makes custom transports and codecs addable without modifying the core.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 38 days ago.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What cellnet Is Built to Solve in Game Server Networking
Game server networking has constraints that general-purpose web frameworks do not address well. A game server must handle many concurrent TCP connections from game clients, speak custom binary protocols that minimize bandwidth, interoperate with third-party SDKs over JSON or HTTP, and route messages between internal service processes over a high-throughput binary protocol. A single server process often needs all of these at the same time.
The README describes three primary domains for cellnet: game servers (custom protocols, logic servers, gateway servers, inter-server communication, third-party SDK integration, protocol translation), ARM devices (inter-device network communication), and securities software (internal RPC). The library is explicitly positioned for situations where you need fine-grained control over the protocol stack, not a convention-over-configuration approach.
The version history in the repository shows four major versions: v1 in August 2015, v2 in January 2017, v3 in August 2017, and v4 in May 2018. The last push to the repository was on 2026-08-24, indicating ongoing maintenance beyond the documented version history.
Transport Protocol Support: TCP, UDP, HTTP, and WebSocket
cellnet supports four transport protocols. TCP connections include automatic reconnection for the connector side (client) and graceful restart for the listener side (server). UDP supports raw packet sending and receiving without additional framing. HTTP support is described in the README as being in testing and is aimed at SDK integration: it supports JSON and form data, and it supports graceful listener restart. The README notes a specific design constraint: if you need to handle large-scale web traffic, use a dedicated web framework like gin instead. cellnet's HTTP support is for the narrow case of a game server that must also speak to a third-party SDK endpoint.
WebSocket support is implemented using github.com/gorilla/websocket. This makes cellnet usable as the server for a browser-based client or a Unity3D client communicating over WebSocket.
All four transports share the same Peer abstraction. A Peer is an endpoint (either a listener that accepts incoming connections or a connector that dials outward). Switching transports for a given Peer type changes the string identifier passed when creating the Peer, not the message-handling logic.
Installing cellnet and Running the Chat Example
cellnet requires Go 1.12 or later. The README gives these go get commands for the library and its dependencies:
go get -u -v github.com/davyxu/cellnet
go get -u -v github.com/davyxu/golog
go get -u -v github.com/davyxu/goobjfmt
go get -u -v github.com/davyxu/protoplusThe repository includes a chat example that demonstrates the basic server and client setup. To run the server:
cd examples/chat/server
go run main.goAnd the client:
cd examples/chat/client
go run main.goAfter both are running, typing hello and pressing Enter in the client terminal produces the server output:
sid1 say: helloBeyond the chat example, the repository includes echo, fileserver, and websocket examples under the examples/ directory. Each demonstrates a different transport or use case.
The Codec System: Four Formats with Mixed-Codec Support
cellnet supports four built-in codecs. Google Protobuf is described in the README as suitable for inter-server communication due to its small packet size and wide platform support. JSON is for communication with third-party servers. The binary protocol (goobjfmt) serializes directly from memory and is intended for intra-network server communication where GC overhead and implementation complexity matter. ProtoPlus is an enhanced Protobuf format maintained by the same author.
The README states that you can configure a server to send and receive different codecs simultaneously without changing the message-handling code, by adjusting how messages are registered. The README gives three concrete use cases for this: using Protobuf between Go services, using JSON with a web server, and using ProtoPlus when communicating with a Unity3D C# client.
Custom codecs can be added through the codec package interface. The README describes this as adding a new codec by implementing the codec package's interface. This allows integrating codecs that cellnet does not ship with, without forking the library.
The binary codec (goobjfmt) is described as suitable for private protocol scenarios where you want both encryption and low GC overhead. The README notes that private binary protocols make encryption easier to integrate and are simpler for clients to parse.
Message Processing Models: Queue-Based Dispatch
cellnet routes all messages and events through an EventQueue. This design decouples network I/O from business logic and enables three distinct processing models in the same codebase.
The first is single-threaded async, where all messages are processed sequentially in one goroutine. The README states this is suitable for MMORPG-style complex interactions because shared data does not need locking. The second is multi-threaded sync, where each actor (such as a robot in a simulation) has its own goroutine and processes messages independently. The third is multi-threaded concurrent, where each message is dispatched in a fully concurrent goroutine, without ordering guarantees. The README describes this as appropriate for gateways, message forwarding, and HTTP servers where each message can be handled independently.
The choice of processing model does not change the network code. It changes how the EventQueue is configured and how the Processor dispatches incoming events. The Processor interface is defined in cellnet/processor.go.
cellnet also supports synchronous and asynchronous RPC. Synchronous RPC is described as useful for a background service that requests data from another service before continuing its transaction. Asynchronous RPC is for single-threaded servers where blocking would halt all message processing.
Limitations: HTTP Is Not for Web Traffic, Protobuf Needs a Plugin
The README is explicit about the HTTP transport's scope: it is not designed for large-scale web page serving. If your game server needs to expose a REST API for web clients at scale, cellnet is not the right transport for that part. The README suggests using gin or another dedicated framework for that case.
Using Protobuf with cellnet requires a custom protoc plugin. The README links to separate documentation for installing the Protobuf codec plugin, which generates binding code for cellnet's message registration. This is an extra step that developers comfortable with standard Protobuf tooling may not expect.
WebSocket support depends on gorilla/websocket, which appears in the go.mod file. That dependency is a third-party library and adds a maintenance dependency.
The README is written primarily in Chinese. An English-speaking developer adopting cellnet will need to use translation tools for the majority of the linked documentation, including the queue, peer, codec, and processor reference pages, which are separate Markdown files linked from the README but written in Chinese.
Alternative: gnet
gnet is another Go network library focused on high-performance, event-driven networking. It uses a reactor pattern with a goroutine-per-core model rather than a queue-per-connection model, and it targets applications where raw throughput per CPU core is the primary concern.
The difference in approach is scope. cellnet provides a complete stack for game server development: transports, codecs, processing models, and RPC in one library, with an explicit design for mixing protocols in one server. gnet focuses on raw I/O throughput and leaves codec and business logic to the application.
For a game server that needs mixed Protobuf-plus-JSON communication between client and backend services, cellnet is the more directly applicable tool. For a proxy, a message broker, or any application where the bottleneck is raw packet processing rather than protocol diversity, gnet's architecture is more appropriate.
License and Repository State
cellnet is licensed under MIT. The repository is not archived. The go.mod file specifies module github.com/davyxu/cellnet with go 1.12 as the minimum version. The dependencies listed are golog, goobjfmt, protoplus (all from the same author), go-sql-driver/mysql, gorilla/websocket, and mediocregopher/radix.v2 for Redis. The last push to the repository was on 2026-08-24. There are no GitHub releases; the project uses the version history documented in CHANGES.md files tagged per major version branch.
Editorial conclusion
cellnet is a practical choice for Go game server development that requires mixing multiple codec formats or running different message-processing models in the same server process. Its layered Peer/Processor/Codec architecture makes custom transports and codecs addable without modifying the core. It is not a general-purpose web framework; the README explicitly notes that HTTP support is for SDK integration with game clients, not for large-scale web traffic. Developers who need a battle-tested HTTP layer should use a dedicated web framework. The last push was on 2026-08-24. The repository is MIT-licensed.
Frequently asked questions
What transport protocols does cellnet support?
cellnet supports TCP, UDP, HTTP, and WebSocket. The README notes that HTTP support is for game SDK integration, not large-scale web traffic, and WebSocket is implemented via gorilla/websocket.
What codec formats does cellnet support?
cellnet supports Google Protobuf, JSON, a binary protocol called goobjfmt, and ProtoPlus. The README describes a mixed-codec mode where a server can send and receive different codecs simultaneously without changing message-handling code.
How do I install cellnet and its dependencies?
Run go get -u -v github.com/davyxu/cellnet, then get the three companion libraries: github.com/davyxu/golog, github.com/davyxu/goobjfmt, and github.com/davyxu/protoplus. Go 1.12 or later is required.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/davyxu-cellnet)