RepositoryGo
9b9387

9b9387/zero

A Lightweight Socket Service with heartbeat, Can be easily used in TCP server development.

174stars
59forks
0issues
2views

zero

A Lightweight Socket Service with heartbeat, Can be easily used in TCP server development.

Build Status Go Report Card GoDoc

Wiki Page https://github.com/9b9387/zero/wiki

Requirements

Go version: 1.9.x or later

Usage

go get -u github.com/9b9387/zero
import "github.com/9b9387/zero"

func main() {
 	host := "127.0.0.1:18787"

 	ss, err := zero.NewSocketService(host)
	if err != nil {
		return
	}

	// set Heartbeat
	ss.SetHeartBeat(5*time.Second, 30*time.Second)

	// net event
	ss.RegMessageHandler(HandleMessage)
	ss.RegConnectHandler(HandleConnect)
	ss.RegDisconnectHandler(HandleDisconnect)

	ss.Serv()
}


Example Code: https://github.com/9b9387/zero/blob/master/service_test.go

Demo

Unity Client Repository https://github.com/9b9387/zero_unity_demo

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
Pumpkin-MC/Pumpkin

Empowering everyone to host fast and efficient Minecraft servers

13.1k
Nov 28, 2026
RepositoryJavaScript
4ian/GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.

29.5k
Dec 1, 2026
RepositoryGo
aceld/zinx

A lightweight concurrent server framework based on Golang.

7.8k
Oct 22, 2026
RepositoryGo
davyxu/cellnet

High performance, simple, extensible golang open source network library

4.1k
Aug 24, 2026
RepositoryGo
cw1997/NATBypass

一款lcx.exe在golang下的实现, 可用于内网穿透, 建立TCP反弹隧道用以绕过防火墙入站限制等, This tool is used to establish reverse tunnel in NAT network environment, it can bypass firewall inbound restriction, support all functions of lcx.exe

1.1k
Jul 3, 2026
RepositoryGo
avelino/awesome-go

A curated list of awesome Go frameworks, libraries and software

197.2k
Dec 2, 2026
RepositoryGo
ollama/ollama

Get up and running with Inkling, Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

188.9k
Dec 2, 2026
RepositoryRust
kitao/pyxel

A retro game engine for Python

18.7k
Nov 28, 2026
RepositoryDart
flame-engine/flame

A Flutter based game engine.

10.8k
Dec 2, 2026