community

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackoffConnect = time.Second * 5
View Source
var IpLayerProtocol = "tcp"

Functions

This section is empty.

Types

type IoEvent

type IoEvent struct {
	Neighbour *Neighbour
	Err       error
}

type LibP2pPhysicalCommunicator

type LibP2pPhysicalCommunicator struct {
	Port       int // listening port
	PrivateKey core.PrivKey
	// contains filtered or unexported fields
}

LibP2pPhysicalCommunicator

func (*LibP2pPhysicalCommunicator) ClosePeer

func (c *LibP2pPhysicalCommunicator) ClosePeer(id string)

func (*LibP2pPhysicalCommunicator) Enqueue

func (c *LibP2pPhysicalCommunicator) Enqueue(req *OutgoingRequest)

func (*LibP2pPhysicalCommunicator) GetIncomingChannel

func (c *LibP2pPhysicalCommunicator) GetIncomingChannel() chan *WireMessage

func (*LibP2pPhysicalCommunicator) GetNeighbour

func (c *LibP2pPhysicalCommunicator) GetNeighbour(id string) (neighbour *Neighbour, err error)

func (*LibP2pPhysicalCommunicator) HandlePeerStream

func (c *LibP2pPhysicalCommunicator) HandlePeerStream(s network.Stream)

func (*LibP2pPhysicalCommunicator) InitDefault

func (c *LibP2pPhysicalCommunicator) InitDefault()

func (*LibP2pPhysicalCommunicator) Listen

func (c *LibP2pPhysicalCommunicator) Listen()

func (*LibP2pPhysicalCommunicator) Start

func (c *LibP2pPhysicalCommunicator) Start()

func (*LibP2pPhysicalCommunicator) Stop

func (c *LibP2pPhysicalCommunicator) Stop()

func (*LibP2pPhysicalCommunicator) SuggestConnection

func (c *LibP2pPhysicalCommunicator) SuggestConnection(address string) (peerIds string)

SuggestConnection takes a peer address and try to connect to it.

type Neighbour

type Neighbour struct {
	Id              peer.ID
	Stream          network.Stream
	IoEventChannel  chan *IoEvent
	IncomingChannel chan *WireMessage
	// contains filtered or unexported fields
}

func (*Neighbour) InitDefault

func (c *Neighbour) InitDefault()

func (*Neighbour) Send

func (c *Neighbour) Send(req *Msg)

func (*Neighbour) StartRead

func (c *Neighbour) StartRead()

func (*Neighbour) StartWrite

func (c *Neighbour) StartWrite()

Jump to

Keyboard shortcuts

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