MCPcopy Index your code
hub / github.com/aceld/zinx / main

Function main

examples/zinx_closecallback/server/server.go:45–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45func main() {
46 // Create server / 创建服务器
47 s := znet.NewServer()
48
49 // Set connection start and stop callbacks / 设置连接开始和断开的回调
50 s.SetOnConnStart(DoConnectionBegin)
51 s.SetOnConnStop(DoConnectionLost)
52
53 // Add router / 添加路由
54 s.AddRouter(1, &router.PingRouter{})
55
56 // Start server / 启动服务器
57 fmt.Println("Server starting")
58 s.Serve()
59}

Callers

nothing calls this directly

Calls 5

SetOnConnStartMethod · 0.95
SetOnConnStopMethod · 0.95
AddRouterMethod · 0.95
ServeMethod · 0.95
NewServerFunction · 0.92

Tested by

no test coverage detected