Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultUDPPort = 53
DefaultUDPPort is the well-known port for generic UDP probes.
View Source
const ProtocolName = "udp"
ProtocolName is the registered name for the UDP transport.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UDP ¶
type UDP struct{}
UDP implements greet.TransportLayer for UDP probes. Because UDP is connectionless, Dial sends an empty datagram and waits for any response to capture RTT. The returned conn is the live UDPConn; since no app layers run over UDP today the engine closes it immediately after Dial.
func (*UDP) DefaultPort ¶
func (*UDP) Dial ¶ added in v1.0.3
func (u *UDP) Dial(ctx context.Context, start time.Time, host string, port int) (net.Conn, time.Duration, time.Duration, error)
Dial resolves host, sends an empty datagram, waits for a response, and returns the UDPConn together with TTDR and RTT. RTT is the send→receive round trip. The caller is responsible for closing the returned conn.
Click to show internal directories.
Click to hide internal directories.