Documentation
¶
Index ¶
Constants ¶
View Source
const (
PacketSize = 48
)
Variables ¶
View Source
var ( ErrInvalidPacket = errors.New("invalid packet format") ErrPlatformNotSupported = errors.New("platform not supported") )
Functions ¶
This section is empty.
Types ¶
type BasicReflector ¶
type BasicReflector struct {
// contains filtered or unexported fields
}
Reflector listens for incoming TWAMP probe packets and reflects them back to the sender.
It runs a single-threaded event loop using a UDP socket with a read timeout. The reflector is designed for test environments or single-client usage and is not optimized for high concurrency.
Use Run(ctx) to start the reflector; it blocks until the context is cancelled. Use Close() to stop the reflector and release the socket.
Reflector is not safe for concurrent use.
func NewBasicReflector ¶
func (*BasicReflector) Close ¶
func (r *BasicReflector) Close() error
Close closes the TWAMP reflector by closing the listener connection.
func (*BasicReflector) LocalAddr ¶
func (r *BasicReflector) LocalAddr() *net.UDPAddr
LocalAddr returns the address the reflector is listening on.
type BasicSender ¶
type BasicSender struct {
// contains filtered or unexported fields
}
func NewBasicSender ¶
func (*BasicSender) Close ¶
func (s *BasicSender) Close() error
func (*BasicSender) LocalAddr ¶
func (s *BasicSender) LocalAddr() *net.UDPAddr
LocalAddr returns the local address of the sender connection.
type LinuxReflector ¶
type LinuxReflector struct {
// contains filtered or unexported fields
}
func NewLinuxReflector ¶
func NewLinuxReflector(addr string, timeout time.Duration) (*LinuxReflector, error)
func (*LinuxReflector) Close ¶
func (r *LinuxReflector) Close() error
func (*LinuxReflector) LocalAddr ¶
func (r *LinuxReflector) LocalAddr() *net.UDPAddr
type LinuxSender ¶
type LinuxSender struct {
// contains filtered or unexported fields
}
func NewLinuxSender ¶
func (*LinuxSender) Close ¶
func (s *LinuxSender) Close() error
func (*LinuxSender) LocalAddr ¶
func (s *LinuxSender) LocalAddr() *net.UDPAddr
type Packet ¶
func UnmarshalPacket ¶
Click to show internal directories.
Click to hide internal directories.