MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / isConnectionDead

Method isConnectionDead

server/player/conn.go:46–49  ·  view source on GitHub ↗

isConnectionDead checks if more than 15 seconds have passed since the client sent a keep alive packet

()

Source from the content-addressed store, hash-verified

44
45// isConnectionDead checks if more than 15 seconds have passed since the client sent a keep alive packet
46func (p *Player) isConnectionDead() bool {
47 lastKeepAliveByClient := p.sbLastKeepalive.Load()
48 return lastKeepAliveByClient != 0 && time.Now().UnixMilli()-lastKeepAliveByClient > (15*1000)
49}
50
51func (p *Player) listenPackets() {
52 keepAliveTicker := time.NewTicker(time.Second * 20)

Callers 1

listenPacketsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected