客户端自定义业务
(conn ziface.IConnection)
| 21 | |
| 22 | // 客户端自定义业务 |
| 23 | func business(conn ziface.IConnection) { |
| 24 | |
| 25 | for { |
| 26 | err := conn.SendMsg(1, []byte("ping ping ping ...")) |
| 27 | if err != nil { |
| 28 | fmt.Println(err) |
| 29 | |
| 30 | } |
| 31 | time.Sleep(1 * time.Second) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // 创建连接的时候执行 |
| 36 | func DoClientConnectedBegin(conn ziface.IConnection) { |
no test coverage detected