dht_node

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DhtNode

type DhtNode struct {
	Node *dht.Server
	// contains filtered or unexported fields
}

func New

func New(
	nodeAddr *net.UDPAddr,
	torrentInfoHash [20]byte,
	startingNodes []dht.Addr,
	peerPort uint16,
	onNewPeerReceived func(peer peers.Peer)) (*DhtNode, error)

New creates a new DHT Node. peerPort, the port the controlling peer is listening to onNewPeerReceived, a function to be executed when a new Peer was found, used for adding the new peer to the controlling peers storage

func (*DhtNode) Close

func (d *DhtNode) Close()

func (*DhtNode) Port

func (d *DhtNode) Port() *uint16

func (*DhtNode) PrintStats

func (d *DhtNode) PrintStats()

Jump to

Keyboard shortcuts

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