MCPcopy Create free account
hub / github.com/coder/coder / Ping

Method Ping

tailnet/conn.go:569–575  ·  view source on GitHub ↗

Ping sends a ping to the Wireguard engine. The bool returned is true if the ping was performed P2P.

(ctx context.Context, ip netip.Addr)

Source from the content-addressed store, hash-verified

567// Ping sends a ping to the Wireguard engine.
568// The bool returned is true if the ping was performed P2P.
569func (c *Conn) Ping(ctx context.Context, ip netip.Addr) (time.Duration, bool, *ipnstate.PingResult, error) {
570 dur, p2p, pr, err := c.pingWithType(ctx, ip, tailcfg.PingDisco)
571 if err == nil {
572 c.sendPingTelemetry(pr)
573 }
574 return dur, p2p, pr, err
575}
576
577func (c *Conn) pingWithType(ctx context.Context, ip netip.Addr, pt tailcfg.PingType) (time.Duration, bool, *ipnstate.PingResult, error) {
578 errCh := make(chan error, 1)

Callers 1

TestTailnetFunction · 0.95

Implementers 1

fakeConnvpn/tunnel_internal_test.go

Calls 2

pingWithTypeMethod · 0.95
sendPingTelemetryMethod · 0.95

Tested by 1

TestTailnetFunction · 0.76