Custom business logic of the client (客户端自定义业务)
(conn ziface.IConnection)
| 19 | |
| 20 | // Custom business logic of the client (客户端自定义业务) |
| 21 | func 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 (创建连接的时候执行) |
| 36 | func DoClientConnectedBegin(conn ziface.IConnection) { |
no test coverage detected