reliable

package
v0.0.0-...-a89a5ae Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPeer

func NewPeer(address *net.UDPAddr, c Connection) *peer

func NewReliableConnection

func NewReliableConnection() (*con, error)

Types

type AtomicBool

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

func (*AtomicBool) Get

func (b *AtomicBool) Get() bool

func (*AtomicBool) Set

func (b *AtomicBool) Set(value bool)

type Connection

type Connection interface {
	FindOrAddPeer(address *net.UDPAddr) *peer
	GetPeerList() []*peer
	GetListenAddresses() []*net.UDPAddr
	GetIncomingPacketChannel() chan *packet
	IsOnline() bool
	GetSweepInterval() time.Duration
	// contains filtered or unexported methods
}

type Packet

type Packet interface {
	GetPeer() Peer
	GetPayload() []byte
	IsData() bool
}

type Peer

type Peer interface {
	SendData(payload []byte)
	SendPacket(pkt *packet)
	ReceivePacket(pkt *packet)
	IsAlive(wait time.Duration) bool
	Equal(p2 Peer) bool
	GetAddress() *net.UDPAddr
}

Jump to

Keyboard shortcuts

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