Movatterモバイル変換


[0]ホーム

URL:


ping

package
v1.92.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:19Imported by:5

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package ping allows sending ICMP echo requests to a host in order todetermine network latency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeListenPacketeradded inv1.42.0

type ListenPacketer interface {ListenPacket(ctxcontext.Context, typstring, addrstring) (net.PacketConn,error)}

PacketListener defines the interface required to listen to packageson an address.

typePinger

type Pinger struct {Logflogger.LogfVerbosebool// contains filtered or unexported fields}

Pinger represents a set of ICMP echo requests to be sent at a single time.

A new instance should be created for each concurrent set of ping requests;this type should not be reused.

funcNew

New creates a new Pinger. The Context provided will be used to createnetwork listeners, and to set an absolute deadline (if any) on the net.Conn

func (*Pinger)Close

func (p *Pinger) Close()error

func (*Pinger)Send

func (p *Pinger) Send(ctxcontext.Context, destnet.Addr, data []byte) (time.Duration,error)

Send sends an ICMP Echo Request packet to the destination, waits for aresponse, and returns the duration between when the request was sent andwhen the reply was received.

If provided, "data" is sent with the packet and is compared upon receiving areply.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp