MCPcopy Index your code
hub / github.com/dearcode/candy / Heartbeat

Method Heartbeat

gate/server.go:313–328  ·  view source on GitHub ↗

Heartbeat nil.

(ctx context.Context, req *meta.GateHeartbeatRequest)

Source from the content-addressed store, hash-verified

311
312// Heartbeat nil.
313func (g *Gate) Heartbeat(ctx context.Context, req *meta.GateHeartbeatRequest) (*meta.GateHeartbeatResponse, error) {
314 s, err := g.getSession(ctx)
315 if err != nil {
316 return &meta.GateHeartbeatResponse{}, nil
317 }
318
319 //已经离线就不在处理
320 if !s.isOnline() {
321 return &meta.GateHeartbeatResponse{}, nil
322 }
323
324 //更新心跳信息
325 s.heartbeat()
326
327 return &meta.GateHeartbeatResponse{}, nil
328}
329
330// Push recv Notice server Message, and send Message to client.
331func (g *Gate) Push(ctx context.Context, req *meta.GatePushRequest) (*meta.GatePushResponse, error) {

Callers

nothing calls this directly

Calls 3

getSessionMethod · 0.95
isOnlineMethod · 0.80
heartbeatMethod · 0.80

Tested by

no test coverage detected