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

Method Handle

znet/server_test.go:91–100  ·  view source on GitHub ↗

Test Handle

(request ziface.IRequest)

Source from the content-addressed store, hash-verified

89
90// Test Handle
91func (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
103func (this *PingRouter) PostHandle(request ziface.IRequest) {

Callers

nothing calls this directly

Calls 4

GetMsgIDMethod · 0.65
GetDataMethod · 0.65
SendMsgMethod · 0.65
GetConnectionMethod · 0.65

Tested by

no test coverage detected