conn

package
v0.0.0-...-d9fbfd9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotEcho = errors.New("not echo")

ErrNotEcho is returned if the icmp message is not an echo

View Source
var ErrNotRunning = errors.New("not running")

ErrNotRunning is returned if a ping is sent through a connection that is not running

View Source
var ErrTooShort = errors.New("too short")

ErrTooShort is returned if the icmp message is too short

View Source
var ErrWrongType = errors.New("wrong type")

ErrWrongType is returned if the packet is not an icmp packet

Functions

This section is empty.

Types

type Conn

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

Conn holds a connection, either ipv4 or ipv6

func New

func New(proto int, h func(*ping.Ping, error)) *Conn

New returns a new Conn

func (*Conn) Run

func (c *Conn) Run(workers int) error

Run runs the workers for the Conn

func (*Conn) Send

func (c *Conn) Send(p *ping.Ping) (time.Time, error)

Send sends a ping through a Conn

func (*Conn) Stop

func (c *Conn) Stop() error

Stop stops the Conn

Jump to

Keyboard shortcuts

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