MCPcopy
hub / github.com/aceld/zinx / business

Function business

examples/zinx_client/main.go:21–33  ·  view source on GitHub ↗

Custom business logic of the client (客户端自定义业务)

(conn ziface.IConnection)

Source from the content-addressed store, hash-verified

19
20// Custom business logic of the client (客户端自定义业务)
21func business(conn ziface.IConnection) {
22
23 for {
24 err := conn.SendMsg(100, []byte("Ping...[FromClient]"))
25 if err != nil {
26 fmt.Println(err)
27 zlog.Error(err)
28 break
29 }
30
31 time.Sleep(1 * time.Second)
32 }
33}
34
35// Function to execute when the connection is created (创建连接的时候执行)
36func DoClientConnectedBegin(conn ziface.IConnection) {

Callers 1

DoClientConnectedBeginFunction · 0.70

Calls 2

ErrorFunction · 0.92
SendMsgMethod · 0.65

Tested by

no test coverage detected