net

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnMetric

type ConnMetric struct {
	*net.UDPConn
	// contains filtered or unexported fields
}

ConnMetric is a wrapper of a UDPConn that keeps track of RX and TX bytes.

func (*ConnMetric) RXBytes

func (nc *ConnMetric) RXBytes() uint64

RXBytes returns the RX bytes.

func (*ConnMetric) ReadFromUDP

func (nc *ConnMetric) ReadFromUDP(b []byte) (int, *net.UDPAddr, error)

ReadFromUDP acts like ReadFrom but returns a UDPAddr.

func (*ConnMetric) TXBytes

func (nc *ConnMetric) TXBytes() uint64

TXBytes returns the TX bytes.

func (*ConnMetric) WriteToUDP

func (nc *ConnMetric) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)

WriteToUDP acts like WriteTo but takes a UDPAddr.

Jump to

Keyboard shortcuts

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