transport

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUsableResponse

func IsUsableResponse(message *dns.Msg) bool

IsUsableResponse reports whether a validated DNS response represents a normal resolver outcome. NOERROR includes both answers and valid NODATA; NXDOMAIN is also a useful, authoritative outcome. Resolver errors such as SERVFAIL and REFUSED are transport-valid, but must not win latency scoring.

func ResponseClass

func ResponseClass(message *dns.Msg) string

ResponseClass is deliberately based on DNS response semantics rather than answer count alone. It lets the benchmark identify filtered/divergent responses without declaring valid NODATA responses to be transport errors.

func ResponseCodeName

func ResponseCodeName(rcode int) string

ResponseCodeName returns the conventional DNS response-code name used in reports. Unknown extended or future codes retain their numeric value.

Types

type Factory

type Factory interface {
	Open(context.Context) (Session, error)
}

Factory creates fresh sessions for cold measurements and one reusable session for warm measurements.

func NewFactory

func NewFactory(target catalog.Target, timeout time.Duration) (Factory, error)

type Session

type Session interface {
	Query(ctx context.Context, name string, qtype uint16) (*dns.Msg, error)
	Close() error
}

Session represents a transport connection used by a single benchmark worker. A worker serializes calls, which makes TCP and encrypted stream framing deterministic while still allowing different targets to run in parallel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL