p2p

package
v0.0.0-...-c3fa490 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: GPL-3.0 Imports: 9 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 {
	Peers       []peers.Peer
	PeerID      [20]byte
	InfoHash    [20]byte
	PieceHashes [][20]byte
	PieceLength int
	Length      int
	Name        string
}

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.

Jump to

Keyboard shortcuts

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