davyxu/cellnet: a Go network library for game servers, gateways and internal RPC
High performance, simple, extensible golang open source network library
At a glance
- What is it?
- cellnet is a component-based Go networking library aimed at game servers, ARM device links and internal RPC. It separates peers, processors and codecs so the same message loop can speak TCP, UDP, WebSocket or HTTP in different encodings.
- Who is it for?
- cellnet fits teams building game logic servers, gateways or internal RPC in Go who want the peer, processor and codec layers to stay separable, and who are willing to read the doc/ pages rather than expect a single tutorial.
- 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 83 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 November 15, 2026, and from our analysis. They are not legal advice.
Star history
- davyxu/cellnet4,054 ★ · -2
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| davyxu/cellnet | 4.1k | 4.1k |
-2 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What cellnet is for, and who ends up using it
cellnet is a Go library for building servers that talk over sockets. The README names three domains: game servers, ARM devices exchanging network traffic, and securities software using internal RPC. Those are not casual web workloads. They are long-lived connections, custom packet formats, and processes that need to call each other inside a private network.
The library's pitch is componentisation. A peer is the thing that owns a connection or a listener; a processor is the thing that turns bytes into messages and back; a codec is the wire format. The README says users can extend horizontally at the Processor and Peer layers, and the repository layout backs that up: peer_tcp.go, peer_udp.go, peer_http.go and peer_ws.go sit beside a peer/ directory, and codec/ sits beside codec.go.
So the audience is a team that already knows what its protocol should look like and does not want a framework deciding for it. If you want routing decorators and middleware chains, this is a different shape of tool.
Peers, processors and codecs: how a message actually moves
The README describes the flow with an architecture diagram and a message-processing diagram, and states that the latter corresponds to the interface in cellnet/processor.go. The written mechanism is this: you create an event queue, create a peer through peer.NewGenericPeer with a transport name such as tcp.Acceptor or tcp.Connector, bind that peer to a processor name such as tcp.ltv with proc.BindProcessorHandler, start the peer, then start the queue loop.
Events arrive at your callback as typed values. The README example switches on *cellnet.SessionAccepted, a user message type, and *cellnet.SessionClosed. Sending is a method on the session: ev.Session().Send(&TestEchoACK{...}).
The queue is the part worth pausing on. The README says all messages and events are pushed into that queue, and it lists three processing models built on it: single-threaded asynchronous logic for complex MMORPG interaction so shared data needs no locking, multi-threaded synchronous logic where each bot has its own goroutine, and fully concurrent per-message handling for gateways, forwarding and HTTP servers. That is a real design decision, not marketing: it means the concurrency model is something you select, and getting it wrong is a correctness problem rather than a performance one.
Mixed encodings over one address and peer manager
The codec list is Protobuf, json, a binary format from github.com/davyxu/goobjfmt described as direct in-memory stream serialisation for intranet transfer, and ProtoPlus from github.com/davyxu/protoplus. The README claims you can send and receive different encodings at runtime without changing code, only the message registration.
The stated use case is concrete: Protobuf with servers written in other languages, json with web servers, ProtoPlus with Unity3D C# clients. The README argues this lets you keep Protobuf's small packets for server-to-server traffic while using a private binary format where you want lower GC pressure and easier client handling.
HTTP deserves a caveat the README makes itself. It is marked as in testing, and the README says that for large-scale web traffic you should use a dedicated library such as gin, because cellnet's HTTP support exists mainly to give you a unified address and peer management. Take that at face value. This is an HTTP peer bolted onto a socket library's abstractions, not an HTTP framework.
Installing cellnet and running the chat example
The README requires Go 1.10 or above and gives four go get commands, one for cellnet and three for its companion modules. The repository's go.mod declares module github.com/davyxu/cellnet and go 1.12, and pins github.com/davyxu/golog v0.1.0, github.com/davyxu/goobjfmt v0.1.0 and github.com/davyxu/protoplus v0.1.0, alongside gorilla/websocket v1.4.1 and two other 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/protoplusAfter that the README's first real exercise is the chat example, which ships in the repository under examples/chat with separate server and client directories. Start the server in one terminal:
cd examples/chat/server
go run main.goAnd the client in another:
cd examples/chat/client
go run main.goThen type hello at the client prompt and press enter. The README shows the server replying with a line in the form sid1 say: hello. If you see nothing back, the README does not document a diagnostic path here; the next places to look are the doc/ pages on queue, peer and message processing, which the README links as the basic concepts.
One prerequisite the README does not put in the install block: if you use Protobuf, the README says you need the bundled pb plugin to generate binding code, and links to doc/pbcodec.md for that. Budget time for it separately.
Where cellnet stops being the right tool
The clearest boundary is HTTP. The README states that cellnet's HTTP support is mainly for unified addressing and peer management, and directs large-scale web needs to a dedicated library. If your project is a public web API, cellnet is the wrong layer.
The second boundary is the ecosystem around the codec. Protobuf use requires a generation step through the bundled pb plugin, and the repository also carries a protoc-gen-msg directory, so message binding is part of your build, not something you skip. Teams used to reflection-based serialisation will feel that cost.
The third is maturity signalling. The repository has no published GitHub releases, so there is no tagged release line to pin against; version history in the README jumps from v1 in 2015 to v4 in 2018, and the CHANGES.md files live on separate v2, v3 and v4 branches. The last push was on 2026-08-24, so the code is not abandoned, but the README's own version narrative is old. Treat the documentation pages as the source of truth and read them before committing to an interface.
How cellnet differs from gnet and from a plain net.Conn wrapper
The obvious alternative named in the README is gin, but that is a different category: gin is an HTTP router and middleware stack, while cellnet is a socket and message-processing library whose HTTP peer is explicitly scoped to unified addressing. Choosing gin for a game gateway means rebuilding session management yourself.
A closer comparison is with Go's own net package plus a hand-rolled framing layer. That is what cellnet wraps: peer_tcp.go, peer_udp.go and the peer/ directory are the abstraction over listeners and connectors, and tcp.ltv is a length-type-value framing with logging and RPC hooks. Writing that yourself is entirely feasible and gives you exactly the semantics you want. What you lose is the queue model and the processor binding, and you re-implement reconnection and graceful listener restart, which the README lists as TCP features.
A third comparison is a general RPC framework. cellnet's rpc/ directory supports both synchronous RPC, which the README recommends for backend servers that need data before continuing a transaction, and asynchronous RPC for single-threaded server logic. A general RPC framework will give you service discovery and schema tooling; cellnet gives you RPC over the same peer and queue machinery you already use for messages. That coupling is the point.
Maintenance, licensing and what an upgrade costs
The repository is not archived, and the last push was on 2026-08-24. The repository has no published GitHub releases, so the practical upgrade path is the branch history the README describes, with CHANGES.md on v2, v3 and v4 branches, plus the current master.
The dependency surface is small and pinned in go.mod: golog, goobjfmt and protoplus at v0.1.0, gorilla/websocket at v1.4.1, go-sql-driver/mysql at v1.4.1 and radix.v2. The mysql and radix entries suggest peer_db.go and any Redis connector in the tree carry their own drivers, so an upgrade touches those too. Since the module declares go 1.12 while the README asks for Go 1.10 or above, a modern toolchain will still build it, but you should expect to re-run your Protobuf generation step whenever the codec or message definitions change.
Licensing is MIT, per the README badge and the LICENSE file. That is permissive, and it is compatible with commercial use, but the repository also depends on third-party modules with their own licences, including gorilla/websocket and go-sql-driver/mysql. Check those separately for your distribution model. Nothing here is legal advice.
Editorial conclusion
cellnet fits teams building game logic servers, gateways or internal RPC in Go who want the peer, processor and codec layers to stay separable, and who are willing to read the doc/ pages rather than expect a single tutorial. It is the wrong choice if you need a general-purpose HTTP framework for large-scale web traffic, since the README itself points elsewhere for that, or if you need a maintained release line, because the repository has no published releases and the last push was on 2026-08-24. Before adopting, verify three things in your own checkout: that the module resolves at the version you want, that the tcp.ltv processor and your message registration actually round-trip your own test message, and that the RPC timeout behaviour matches what your server logic assumes.
Frequently asked questions
What Go version does davyxu/cellnet need?
The README says to download Go 1.10 or above to compile and use cellnet, while the repository's go.mod declares go 1.12.
Which transports does davyxu/cellnet support?
The README lists TCP with connector reconnection and graceful listener restart, raw UDP packet send and receive, HTTP marked as in testing, and WebSocket implemented with github.com/gorilla/websocket.
How do I run the davyxu/cellnet chat example?
The README says to run go run main.go inside examples/chat/server in one terminal and examples/chat/client in another, then type hello at the client prompt to see the server reply.
Can davyxu/cellnet replace a web framework for large HTTP traffic?
The README says no. It states that for large-scale web traffic you should use a dedicated library such as gin, and that cellnet's HTTP support exists mainly for unified addressing and peer management.
What licence does davyxu/cellnet use?
The README carries an MIT licence badge and the repository includes a LICENSE file. Its dependencies carry their own licences, which you should check separately.
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)Star history chart for your README
[](https://hysenlabs.com/projects/davyxu-cellnet)Was this useful?