Execute when creating a connection (创建连接的时候执行)
(conn ziface.IConnection)
| 13 | |
| 14 | // Execute when creating a connection (创建连接的时候执行) |
| 15 | func DoConnectionBegin(conn ziface.IConnection) { |
| 16 | zlog.Ins().InfoF("DoConnectionBegin is Called ...") |
| 17 | |
| 18 | //设置两个连接属性,在连接创建之后 |
| 19 | conn.SetProperty("Name", "Aceld") |
| 20 | conn.SetProperty("Home", "https://yuque.com/@aceld") |
| 21 | |
| 22 | err := conn.SendMsg(2, []byte("DoConnection BEGIN...")) |
| 23 | if err != nil { |
| 24 | zlog.Error(err) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // Execute when connection lost (连接断开的时候执行) |
| 29 | func DoConnectionLost(conn ziface.IConnection) { |
nothing calls this directly
no test coverage detected