p2p

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package p2p provides an network interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P2P

type P2P interface {
	Start()
	Halt()
	Connect(addr string) error
	GetID() uint64
	GetVersion() uint32
	GetPort() uint16
	GetHttpInfoPort() uint16
	GetRelay() bool
	GetHeight() uint64
	GetTime() int64
	GetServices() uint64
	GetNeighbors() []*peer.Peer
	GetNeighborAddrs() []common.PeerAddr
	GetConnectionCnt() uint32
	GetNp() *peer.NbrPeers
	GetPeer(uint64) *peer.Peer
	SetHeight(uint64)
	IsPeerEstablished(p *peer.Peer) bool
	Send(p *peer.Peer, msg types.Message) error
	GetMsgChan() chan *types.MsgPayload
	GetPeerFromAddr(addr string) *peer.Peer
	AddOutConnectingList(addr string) (added bool)
	GetOutConnRecordLen() int
	RemoveFromConnectingList(addr string)
	RemoveFromOutConnRecord(addr string)
	RemoveFromInConnRecord(addr string)
	AddPeerAddress(addr string, p *peer.Peer)
	GetOutConnectingListLen() (count uint)
	RemovePeerAddress(addr string)
	AddNbrNode(*peer.Peer)
	DelNbrNode(id uint64) (*peer.Peer, bool)
	NodeEstablished(uint64) bool
	Xmit(msg types.Message)
	SetOwnAddress(addr string)
	IsOwnAddress(addr string) bool
	IsAddrFromConnecting(addr string) bool
}

P2P represent the net interface of p2p package

Jump to

Keyboard shortcuts

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