p2p

package
v0.0.0-...-ef7f9f6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBacklog = 5

MaxBacklog is the number of unfulfilled requests a client can have in its pipeline

View Source
const MaxBlockSize = 16384

MaxBlockSize is the largest number of bytes a request can ask for

Variables

This section is empty.

Functions

This section is empty.

Types

type Torrent

type Torrent struct {
	PeerSet                     peers.PeerSet
	PeerID                      [20]byte
	InfoHash                    [20]byte
	PieceHashes                 [][20]byte
	PieceLength                 int
	Length                      int
	Name                        string
	Local                       string
	PathSelectionResponsibility string
	DhtNode                     *dht_node.DhtNode
	DiscoveryConfig             *config.PeerDiscoveryConfig
	// contains filtered or unexported fields
}

Torrent holds data required to download a torrent from a list of peers

func (*Torrent) Download

func (t *Torrent) Download() ([]byte, error)

Download downloads the torrent. This stores the entire file in memory.

func (*Torrent) EnableDht

func (t *Torrent) EnableDht(addr *net.UDPAddr, peerPort uint16, infoHash [20]byte, startingNodes []dht.Addr) (*dht_node.DhtNode, error)

Jump to

Keyboard shortcuts

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