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

Method SendKeepalivesToPeersWithCurrentKeypair

polyamide/device/device.go:425–440  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

423}
424
425func (device *Device) SendKeepalivesToPeersWithCurrentKeypair() {
426 if !device.isUp() {
427 return
428 }
429
430 device.peers.RLock()
431 for _, peer := range device.peers.keyMap {
432 peer.keypairs.RLock()
433 sendKeepalive := peer.keypairs.current != nil && !peer.keypairs.current.created.Add(RejectAfterTime).Before(time.Now())
434 peer.keypairs.RUnlock()
435 if sendKeepalive {
436 peer.SendKeepalive()
437 }
438 }
439 device.peers.RUnlock()
440}
441
442// closeBindLocked closes the device's net.bind.
443// The caller must hold the net mutex.

Callers 1

TestConcurrencySafetyFunction · 0.80

Implementers 4

NativeTunpolyamide/tun/tun_linux.go
netTunpolyamide/tun/netstack/tun.go
chTunpolyamide/tun/tuntest/tuntest.go
fakeTUNDeviceSizedpolyamide/device/device_test.go

Calls 2

isUpMethod · 0.95
SendKeepaliveMethod · 0.80

Tested by 1

TestConcurrencySafetyFunction · 0.64