autobind

package
v0.0.0-...-7571207 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package autobind for automically binding on the local server this package is only for convience and it's suggested to use torrent.NewSocketsBind instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableDHT

func DisableDHT(a *Autobind)

DisableDHT disables DHT.

func DisableTCP

func DisableTCP(a *Autobind)

DisableTCP disable TCP sockets

func DisableUTP

func DisableUTP(a *Autobind)

DisableUTP disable UTP sockets

func NewDefaultClient

func NewDefaultClient() (c *torrent.Client, err error)

NewDefaultClient setup a client and connect a using defaults settings.

Types

type Autobind

type Autobind struct {
	// The address to listen for new uTP and TCP bittorrent protocol
	// connections. DHT shares a UDP socket with uTP unless configured
	// otherwise.
	ListenHost  func(network string) string
	ListenPort  int
	DisableIPv4 bool
	DisableIPv6 bool
	DisableTCP  bool
	DisableUTP  bool
	NoDHT       bool
}

Autobind manages automatically binding a client to available networks.

func New

func New(options ...Option) Autobind

New used to automatically listen to available networks on the system. limited configuration options. use client.Bind for more robust configuration.

func NewLoopback

func NewLoopback(options ...Option) Autobind

NewLoopback autobind to the loopback device.

func NewSpecified

func NewSpecified(dst string) Autobind

NewSpecified for use in testing only, panics if invalid host/port.

func (Autobind) Bind

func (t Autobind) Bind(cl *torrent.Client, err error) (*torrent.Client, error)

Bind the client to available networks. consumes the result of NewClient.

type Option

type Option func(*Autobind)

Option for configuring autobind.

Jump to

Keyboard shortcuts

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