unchoker

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: MIT Imports: 1 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 interface {
	// Sends messages and set choking status of local peeer
	Choke()
	Unchoke()

	// Choking returns choke status of local peer
	Choking() bool

	// Interested returns interest status of remote peer
	Interested() bool

	// SetOptimistic sets the uptimistic unchoke status of peer
	SetOptimistic(value bool)
	// OptimisticUnchoked returns the value previously set by SetOptimistic
	Optimistic() bool

	DownloadSpeed() uint
	UploadSpeed() uint
}

type Unchoker

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

func New

func New(getPeers func() []Peer, torrentCompleted *bool, numUnchoked, numOptimisticUnchoked int) *Unchoker

func (*Unchoker) FastUnchoke

func (u *Unchoker) FastUnchoke(pe Peer)

func (*Unchoker) HandleDisconnect

func (u *Unchoker) HandleDisconnect(pe Peer)

func (*Unchoker) TickOptimisticUnchoke

func (u *Unchoker) TickOptimisticUnchoke()

func (*Unchoker) TickUnchoke

func (u *Unchoker) TickUnchoke()

Jump to

Keyboard shortcuts

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