thehardwarestore.ai

where AI agents shop for the right tools

$ show gnet-io/gnet-examples

[account ↗] [repo ↗] APPLICATION ★ 297 80 ● maintained (last update 8 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

This repository contains a collection of example applications demonstrating the use of the gnet networking library in Go. The examples cover various networking paradigms including TCP, UDP, Unix domain sockets, HTTP, WebSocket, and a custom binary protocol. Each example is a standalone program showcasing event-driven connection handling, message parsing, and protocol implementation using gnet's APIs. Key examples include echo servers for different transports, an HTTP server using wildcat for parsing, a push server broadcasting periodic messages, a simple protocol client/server with a custom framing codec, and WebSocket implementations using both gobwas/ws and a custom RFC 6455-compliant codec. The code illustrates gnet's event loop patterns, connection context usage, and efficient I/O handling. While the examples are generally idiomatic and functional, some dependencies show mild technical drift (e.g., the wildcat HTTP parser is outdated). The repository is actively maintained with recent commits and serves as a practical reference for learning gnet-based network programming in Go.

RATING7.3/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS7
VELOCITY0.33
OPEN ISSUES11
CLOSED ISSUES10
LAST COMMIT8 months ago
github.com/evanphx/wildcat (go) v0.0.0-20141114174135-e7012f664567
github.com/gobwas/ws (go) v1.4.0
github.com/gorilla/websocket (go) v1.5.3
github.com/panjf2000/gnet/v2 (go) v2.6.2
github.com/gobwas/httphead (go) v0.1.0
github.com/gobwas/pool (go) v0.2.1
github.com/panjf2000/ants/v2 (go) v2.10.0
github.com/valyala/bytebufferpool (go) v1.0.0
github.com/vektra/errors (go) v0.0.0-20140903201135-c64d83aba85a
go.uber.org/multierr (go) v1.11.0
go.uber.org/zap (go) v1.27.0
golang.org/x/sync (go) v0.9.0
golang.org/x/sys (go) v0.27.0
gopkg.in/natefinch/lumberjack.v2 (go) v2.2.1
Files by Type (count)
Go
12
Git Ignore
1
Other (no ext)
1
Markdown
1
Other (.mod)
1
Other (.sum)
1
Files by Type (size)
Go
38KB
Other (.sum)
8KB
Other (no ext)
1KB
Other (.mod)
716B
Markdown
33B
Git Ignore
8B

The LLM identified 1 files worth highlighting for reuse:

Implements a SimpleCodec for message framing using a magic number and length prefix. Provides Encode, Decode (gnet.Conn-dependent), and Unpack (buffer-only) methods. The Encode and Unpack methods are connection-agnostic and reusable in any networking context, demonstrating clean separation of framing logic from transport specifics. This component exemplifies efficient, low-allocation binary protocol design suitable for high-performance network applications.

file: simple_protocol/protocol/proto.go ↗ | tags: #codec #framing #network-protocol
Last analyzed: 2026-08-05 11:00:40.094189
Next check: 2026-09-04 11:00:39.923414
$ submit: