timeoutmap

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

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

Map holds a timeout map, a map of when different pings time out

func New

func New(proto int) *Map

New creates a new timeout map

func (*Map) Add

func (m *Map) Add(ip net.IP, id ping.ID, seq ping.Seq, t time.Time)

Add adds an entry to the timeout map

func (*Map) Del

func (m *Map) Del(ip net.IP, id ping.ID, seq ping.Seq)

Del deletes an entry from the timeout map, this should be called when the ping is received

func (*Map) Next

func (m *Map) Next(ctx context.Context) (ip net.IP, id ping.ID, seq ping.Seq, t time.Time)

Next blocks until the next packet times out, then returns the information for that packet.

func (*Map) Update

func (m *Map) Update(ip net.IP, id ping.ID, seq ping.Seq, t time.Time)

Update updates the timeout on an existing entry It does nothing if the entry does not exist, because it may have already been deleted by being recieved

Jump to

Keyboard shortcuts

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