conn

package
v0.0.0-...-25c57ca Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecondsIn3Days int32 = 3 * 24 * 60 * 60
	SecondsIn4Days int32 = 4 * 24 * 60 * 60
)
View Source
const (
	TorSucceeded           = 0x00
	TorGeneralError        = 0x01
	TorNotAllowed          = 0X02
	TorNetUnreachable      = 0X03
	TorHostUnreachable     = 0x04
	TorConnectionRefused   = 0x05
	TorTTLExpired          = 0x06
	TorCMDNotSupported     = 0x07
	TorAddressNotSupported = 0x08
)

Variables

This section is empty.

Functions

func SeedFromDNS

func SeedFromDNS(chainParams *msg.BitcoinParams, servicesFlag protocol.ServiceFlag,
	lookupFunc utils.LookupFunc, onSeed OnSeed)

Types

type ConnectListener

type ConnectListener struct {
	Listeners       []net.Listener
	OnAccept        func(conn net.Conn)
	TargetOutbound  uint32
	RetryDuration   time.Duration
	OnConnection    func(request *ConnectRequest, conn net.Conn)
	OnDisconnection func(request *ConnectRequest)
	GetNewAddress   func() (net.Addr, error)
	Dial            func(addr net.Addr) (net.Conn, error)
}

type ConnectManager

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

func NewConnectManager

func NewConnectManager(listener *ConnectListener) (*ConnectManager, error)

func (*ConnectManager) Connect

func (connectManager *ConnectManager) Connect(connectRequest *ConnectRequest)

func (*ConnectManager) Disconnect

func (connectManager *ConnectManager) Disconnect(id uint64)

func (*ConnectManager) NewConnectRequest

func (connectManager *ConnectManager) NewConnectRequest()

func (*ConnectManager) Remove

func (connectManager *ConnectManager) Remove(id uint64)

func (*ConnectManager) Start

func (connectManager *ConnectManager) Start()

func (*ConnectManager) Stop

func (connectManager *ConnectManager) Stop()

func (*ConnectManager) Wait

func (connectManager *ConnectManager) Wait()

type ConnectRequest

type ConnectRequest struct {
	Address   net.Addr
	Permanent bool
	Conn      net.Conn
	// contains filtered or unexported fields
}

func (*ConnectRequest) ID

func (connectRequest *ConnectRequest) ID() uint64

func (*ConnectRequest) State

func (connectRequest *ConnectRequest) State() ConnectState

func (*ConnectRequest) String

func (connectRequest *ConnectRequest) String() string

type ConnectState

type ConnectState uint8
const (
	ConnectPending ConnectState = iota
	ConnectEstablished
	ConnectDisconnected
	ConnectFailed
)

type OnSeed

type OnSeed func(addresses []*network.PeerAddress)

Jump to

Keyboard shortcuts

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