Test Handle
(request ziface.IRequest)
| 89 | |
| 90 | // Test Handle |
| 91 | func (this *PingRouter) Handle(request ziface.IRequest) { |
| 92 | fmt.Println("Call PingRouter Handle") |
| 93 | //先读取客户端的数据,再回写ping...ping...ping |
| 94 | fmt.Println("recv from client : msgID=", request.GetMsgID(), ", data=", string(request.GetData())) |
| 95 | |
| 96 | err := request.GetConnection().SendMsg(1, []byte("ping...ping...ping\n")) |
| 97 | if err != nil { |
| 98 | fmt.Println("Handle SendMsg err: ", err) |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | // Test PostHandle |
| 103 | func (this *PingRouter) PostHandle(request ziface.IRequest) { |
nothing calls this directly
no test coverage detected