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

Method Handle

examples/zinx_dynamic_bind/client/client.go:26–30  ·  view source on GitHub ↗

Hash 工作模式下,需要等待接受到client1的pong后,才会收到client2和client3的pong DynamicBind工作模式下,client2, client3 都会立马收到pong, 但client1的pong会被阻塞十秒后才收到

(request ziface.IRequest)

Source from the content-addressed store, hash-verified

24// Hash 工作模式下,需要等待接受到client1的pong后,才会收到client2和client3的pong
25// DynamicBind工作模式下,client2, client3 都会立马收到pong, 但client1的pong会被阻塞十秒后才收到
26func (p *PongRouter) Handle(request ziface.IRequest) {
27 //read server pong data
28 zlog.Infof("---------client:%s, recv from server:%s, msgId=%d, data=%s ----------\n",
29 p.client, request.GetConnection().RemoteAddr(), request.GetMsgID(), string(request.GetData()))
30}
31
32func onClient1Start(conn ziface.IConnection) {
33 zlog.Infof("client1 connection start, %s->%s\n", conn.LocalAddrString(), conn.RemoteAddrString())

Callers

nothing calls this directly

Calls 5

InfofFunction · 0.92
RemoteAddrMethod · 0.65
GetConnectionMethod · 0.65
GetMsgIDMethod · 0.65
GetDataMethod · 0.65

Tested by

no test coverage detected