peer

package
v0.0.0-...-5cffd83 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	UserData []byte
	// contains filtered or unexported fields
}

Peer maintains information about a peer discovered on the network. Because the struct may be used from multiple goroutines, all access to members must be done through accessors that lock a mutex.

func (*Peer) Addrs

func (p *Peer) Addrs() []net.IP

Obtain a sorted list of all addresses for the peer.

func (*Peer) IsExpired

func (p *Peer) IsExpired(timeout time.Duration, curTime time.Time) bool

Remove all expired addresses and sort those that remain.

func (*Peer) Ping

func (p *Peer) Ping(pkt *comm.Packet, curTime time.Time)

Record a ping from the specified address.

Jump to

Keyboard shortcuts

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