# <img width="80px" src="https://s2.ax1x.com/2019/10/09/u4yHo9.png" />
English | [简体中文](README-CN.md)
[![License](https://img.shields.io/badge/License-MIT-black.svg)](LICENSE)
[![Discord](https://img.shields.io/badge/zinx-Discord-blue.svg)](https://discord.gg/xQ8Xxfyfcz)
[![Gitter](https://img.shields.io/badge/zinx-Gitter-green.svg)](https://gitter.im/zinx_go/community)
[![zinx tutorial](https://img.shields.io/badge/ZinxTutorial-YuQue-red.svg)](https://www.yuque.com/aceld/npyr8s/bgftov)
[![Original Book of Zinx](https://img.shields.io/badge/OriginalBook-YuQue-black.svg)](https://www.yuque.com/aceld)
Zinx is a lightweight concurrent server framework based on Golang.
## Document
[ < Zinx Wiki : English > ](https://github.com/aceld/zinx/wiki)
[ < Zinx 文档 : 简体中文> ](https://www.yuque.com/aceld/tsgooa/sbvzgczh3hqz8q3l)
> **Note**:
> Zinx has been widely used in many enterprises for development purposes, including message forwarding for backend modules, long-linked game servers, and message handling plugins for web frameworks.
> Zinx is positioned as a framework with concise code that allows developers to quickly understand the internal details of the framework and easily customize it based on their own enterprise scenarios.
---
## Source of Zinx
### Github
Git: https://github.com/aceld/zinx
### Gitee(China)
Git: https://gitee.com/Aceld/zinx
### Website
http://zinx.me
---
## Online Tutorial
| platform | Entry |
| ---- | ---- |
| <img src="https://user-images.githubusercontent.com/7778936/236784004-b6d99e26-b1ab-4bc3-988e-7a46108b85fe.png" width = "100" height = "100" alt="" align=center />| [Zinx Framework tutorial-Lightweight server based on Golang](https://dev.to/aceld/1building-basic-services-with-zinx-framework-296e)|
|<img src="https://user-images.githubusercontent.com/7778936/236784168-6528a9b8-d37b-4b02-a37c-b9988d7508d8.jpeg" width = "100" height = "100" alt="" align=center />|[《Golang轻量级并发服务器框架zinx》](https://www.yuque.com/aceld)|
## Online Tutorial Video
| platform | online video |
| ---- | ---- |
| <img src="https://s1.ax1x.com/2022/09/22/xFePUK.png" width = "100" height = "100" alt="" align=center />| [![zinx-BiliBili](https://s2.ax1x.com/2019/10/13/uv340S.jpg)](https://www.bilibili.com/video/av71067087)|
| <img src="https://s1.ax1x.com/2022/09/22/xFeRVx.png" width = "100" height = "100" alt="" align=center /> | [![zinx-BiliBili](https://s2.ax1x.com/2019/10/13/uv340S.jpg)](https://www.douyin.com/video/6983301202939333891) |
| <img src="https://s1.ax1x.com/2022/09/23/xkQcng.png" width = "100" height = "100" alt="" align=center />| [![zinx-youtube](https://s2.ax1x.com/2019/10/14/KSurCR.jpg)](https://www.youtube.com/watch?v=U95iF-HMWsU&list=PL_GrAPKmuajzeNI8HBTi-k5NQO1g0rM-A)|
## I. One word that has been said before
Why did we create Zinx? Although there are many Golang application frameworks for servers, there are few lightweight enterprise frameworks applied in the gaming or other long-linked fields.
The purpose of designing Zinx is to provide a complete outline of how to write a TCP server based on Golang, so that more Golang enthusiasts can learn and understand this field in a straightforward manner.
The development of the Zinx framework project is synchronized with the creation of learning tutorials, and all the incremental and iterative thinking involved in the development process is incorporated into the tutorials. This approach avoids overwhelming beginners with a complete framework that they may find difficult to grasp all at once.
The tutorials will be iterated version by version, with each version adding small increments of functionality, allowing a beginner to gradually and comprehensively learn about the field of server frameworks.
Of course, we hope that more people will join Zinx and provide us with valuable feedback, enabling Zinx to become a truly enterprise-level server framework. Thank you for your attention!
### Reply from chatGPT(AI)
![what-is-zinx](https://user-images.githubusercontent.com/7778936/209745848-acfc14eb-74cd-4513-b386-8bc6e0bcc09f.png)
![compare-zinx](https://user-images.githubusercontent.com/7778936/209745864-7d8984b0-bd73-4109-b4ec-aec152f8f8e8.png)
### The honor of zinx
#### GVP Most Valuable Open Source Project of the Year at OSCHINA
![GVP-zinx](https://s2.ax1x.com/2019/10/13/uvYVBV.jpg)
## II. Zinx architecture
![Zinx框架](https://user-images.githubusercontent.com/7778936/220058446-0ad45112-2225-4b71-b0d8-69a7f3cee5ca.jpg)
![流程图](https://raw.githubusercontent.com/wenyoufu/testaaaaaa/master/%E6%B5%81%E7%A8%8B%E5%9B%BE-en.jpg)
![zinx-start](https://user-images.githubusercontent.com/7778936/126594039-98dddd10-ec6a-4881-9e06-a09ec34f1af7.gif)
## III. Zinx development API documentation
### (1) QuickStart
[<Zinx's TCP Debugging Tool>](https://github.com/xxl6097/tcptest)
DownLoad zinx Source
```bash
$go get github.com/aceld/zinx
```
> note: Golang Version 1.17+
#### Zinx-Server
```go
package main
import (
"fmt"
"github.com/aceld/zinx/ziface"
"github.com/aceld/zinx/znet"
)
// PingRouter MsgId=1
type PingRouter struct {
znet.BaseRouter
}
//Ping Handle MsgId=1
func (r *PingRouter) Handle(request ziface.IRequest) {
//read client data
fmt.Println("recv from client : msgId=", request.GetMsgID(), ", data=", string(request.GetData()))
}
func main() {
//1 Create a server service
s := znet.NewServer()
//2 configure routing
s.AddRouter(1, &PingRouter{})
//3 start service
s.Serve()
}
```
Run Server
```bash
$ go run server.go
```
```bash
██
▀▀
████████ ████ ██▄████▄ ▀██ ██▀
▄█▀ ██ ██▀ ██ ████
▄█▀ ██ ██ ██ ▄██▄
▄██▄▄▄▄▄ ▄▄▄██▄▄▄ ██ ██ ▄█▀▀█▄
▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀ ▀▀ ▀▀ ▀▀▀ ▀▀▀
┌──────────────────────────────────────────────────────┐
│ [Github] https://github.com/aceld │
│ [tutorial] https://www.yuque.com/aceld/npyr8s/bgftov │
└──────────────────────────────────────────────────────┘
[Zinx] Version: V1.0, MaxConn: 12000, MaxPacketSize: 4096
===== Zinx Global Config =====
Host: 0.0.0.0
TCPPort: 8999
Name: ZinxServerApp
Version: V1.0
MaxPacketSize: 4096
MaxConn: 12000
WorkerPoolSize: 10
MaxWorkerTaskLen: 1024
MaxMsgChanLen: 1024
ConfFilePath: /Users/Aceld/go/src/zinx-usage/quick_start/conf/zinx.json
LogDir: /Users/Aceld/go/src/zinx-usage/quick_start/log
LogFile:
LogIsolationLevel: 0
HeartbeatMax: 10
==============================
2023/03/09 18:39:49 [INFO]msghandler.go:61: Add api msgID = 1
2023/03/09 18:39:49 [INFO]server.go:112: [START] Server name: ZinxServerApp,listenner at IP: 0.0.0.0, Port 8999 is starting
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 0 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 1 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 3 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 2 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 4 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 6 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 7 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 8 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 9 is started.
2023/03/09 18:39:49 [INFO]msghandler.go:66: Worker ID = 5 is started.
2023/03/09 18:39:49 [
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Go 的轻量级并发TCP服务器框架.zip
共308个文件
go:173个
json:19个
dll:12个
需积分: 5 0 下载量 172 浏览量
2024-05-15
14:30:13
上传
评论
收藏 16.52MB ZIP 举报
温馨提示
Google对Go寄予厚望。其设计是让软件充分发挥多核心处理器同步多工的优点,并可解决面向对象程序设计的麻烦。它具有现代的程序语言特色,如垃圾回收,帮助程序设计师处理琐碎和重要的内存管理等问题。Go的速度也非常快,几乎和C或C++程序一样快,且能够快速制作程序。 Go的网站就是用Go语言开发的,但Google有更大的野心。该软件是专为构建服务器软件所设计(如Google的Gmail)。Google认为Go还可应用到其他领域,包括在浏览器内执行软件,取代JavaScript的角色。 Pike说:它至少在强度上比JavaScript高一级。Google自建Chrome浏览器,部分原因就是加速JavaScript和网页表现,而Google已经融合了本身的技术,如Native Client和Gears。 Pike表示,Go另一项与网络相关的特色,是服务器和用户端设备,如PC或手机,可以分担工作。因此,使用Go的服务便可轻松适应不同的用户端处理性能。 Go也可解决现今的一大挑战:多核心处理器。一般电脑程序通常依序执行,一次进行一项工作,但多核心处理器更适合并行处理许多工作。
资源推荐
资源详情
资源评论
收起资源包目录
基于 Go 的轻量级并发TCP服务器框架.zip (308个子文件)
DefaultWsdlHelpGenerator.aspx 59KB
DefaultWsdlHelpGenerator.aspx 57KB
sharedassets1.assets 3.41MB
resources.assets 1.3MB
sharedassets0.assets 24KB
globalgamemanagers.assets 12KB
Compat.browser 2KB
8d1834f70e47b17a9d8a767b83fee37a.caw 48KB
acf69143ed00df88a7ce289e9ba4a04c.caw 47KB
d1927eb117f2eb4a298976e370b491ce.caw 46KB
9bd8ac3a19e2b290a3e08ca6baadad51.caw 45KB
machine.config 27KB
machine.config 17KB
web.config 11KB
config 2KB
mscorlib.dll 2.38MB
mono.dll 2.02MB
System.Xml.dll 1.18MB
UnityEngine.dll 1.06MB
System.dll 1.02MB
Mono.Security.dll 287KB
System.Core.dll 260KB
Google.Protobuf.dll 255KB
UnityEngine.Networking.dll 230KB
UnityEngine.UI.dll 216KB
protobuf-net.dll 184KB
Assembly-CSharp.dll 41KB
dockerfile 136B
9bd8ac3a19e2b290a3e08ca6baadad51.ecm 16KB
acf69143ed00df88a7ce289e9ba4a04c.ecm 16KB
8d1834f70e47b17a9d8a767b83fee37a.ecm 16KB
d1927eb117f2eb4a298976e370b491ce.ecm 16KB
client.exe 16.91MB
.gitattributes 28B
.gitignore 329B
globalgamemanagers 31KB
framedecoder.go 26KB
server.go 18KB
kcp_connection.go 18KB
ws_connection.go 17KB
connection.go 15KB
msg.pb.go 12KB
player.go 12KB
logger_core.go 12KB
msghandler.go 11KB
bili0x15router.go 10KB
globalobj.go 9KB
shard_lock_map_test.go 9KB
client.go 9KB
witer.go 8KB
ltvdecoder_little.go 7KB
tlvdecoder.go 7KB
shard_lock_map.go 7KB
timewheel.go 7KB
aoi.go 7KB
shard_lock_map_bench_test.go 7KB
request.go 6KB
Person.pb.go 6KB
htlvcrcdecoder.go 6KB
client_AI_robot.go 6KB
heartbeat.go 5KB
server_test.go 5KB
server.go 5KB
router.go 4KB
crc.go 4KB
client.go 4KB
iconnection.go 3KB
irequest.go 3KB
timerscheduler.go 3KB
async_op.go 3KB
userconf.go 3KB
async_op_result.go 3KB
Server.go 3KB
stdzlog.go 3KB
connmanager.go 3KB
RouterFuncApi.go 3KB
world_manager.go 3KB
datapack_tlv_bigendian_test.go 3KB
iserver.go 3KB
server.go 3KB
notify.go 3KB
datapack_ltv_littleendian.go 3KB
bili0x10router.go 2KB
defaultrouterfunc.go 2KB
datapack_tlv_bigendian.go 2KB
client.go 2KB
main.go 2KB
Server.go 2KB
timewheel_test.go 2KB
iclient.go 2KB
notify_test.go 2KB
timer.go 2KB
Server.go 2KB
irouter.go 2KB
login.go 2KB
timerscheduler_test.go 2KB
chain.go 2KB
bili0x13router.go 2KB
snowflake_uuid.go 2KB
zlog_test.go 2KB
共 308 条
- 1
- 2
- 3
- 4
资源评论
野生的狒狒
- 粉丝: 2992
- 资源: 2297
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功