netest

package module
v0.0.0-...-2217a4a Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Kilobyte = 1024.0
	Megabyte = 1048576.0
	Gigabyte = 1073741824.0
)

Variables

View Source
var MTU = 1500
View Source
var Patterns = [][]byte{
	[]byte{0xff},
	[]byte{0x00},
}

Functions

func Humanize

func Humanize(v float64) string

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

type Packet

type Packet struct {
	PacketHeader
	Payload []byte
}

type PacketHeader

type PacketHeader struct {
	Length   uint16
	Sequence uint16
}

type PatternType

type PatternType uint8
const (
	AllOnesPattern PatternType = iota
	AllZerosPattern
)

type Sink

type Sink struct {
	*Connection
	// contains filtered or unexported fields
}

func NewTCPSink

func NewTCPSink(laddr string) (*Sink, error)

func NewUDPSink

func NewUDPSink(laddr string) (*Sink, error)

func (*Sink) Close

func (s *Sink) Close()

func (*Sink) ReceiveMsg

func (s *Sink) ReceiveMsg() *Packet

type Source

type Source struct {
	*Connection
	// contains filtered or unexported fields
}

func NewTCPSource

func NewTCPSource(laddr, raddr string) (*Source, error)

func NewUDPSource

func NewUDPSource(laddr, raddr string) (*Source, error)

func (*Source) Close

func (s *Source) Close()

func (*Source) SendMsg

func (s *Source) SendMsg(payload []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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