MCPcopy Create free account
hub / github.com/encodeous/nylon / SetPersistentKeepaliveInterval

Method SetPersistentKeepaliveInterval

polyamide/device/peer.go:380–388  ·  view source on GitHub ↗
(interval time.Duration)

Source from the content-addressed store, hash-verified

378}
379
380func (peer *Peer) SetPersistentKeepaliveInterval(interval time.Duration) {
381 old := peer.persistentKeepaliveInterval.Swap(uint32(interval.Seconds()))
382
383 // Send immediate keepalive if we're turning it on and before it wasn't on.
384 if old == 0 && interval.Seconds() != 0 {
385 peer.SendKeepalive()
386 peer.SendStagedPackets()
387 }
388}

Callers

nothing calls this directly

Calls 3

SendKeepaliveMethod · 0.95
SendStagedPacketsMethod · 0.95
SwapMethod · 0.80

Tested by

no test coverage detected