transport

package
v0.0.0-...-a53bfeb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	READ     = 0 // close by read error
	WRITE    = 1 // close by write error
	ACTIVELY = 2 // actively closed on demand

)

Variables

View Source
var IpLayerProtocol = "tcp"

var BackoffConnect = time.Second * 5

Functions

This section is empty.

Types

type IoEvent

type IoEvent struct {
	Neighbour *Neighbour
	Err       error
	Reason    string
}

type Neighbour

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

func (*Neighbour) CloseOutgoing

func (c *Neighbour) CloseOutgoing()

func (*Neighbour) EnqueueSend

func (c *Neighbour) EnqueueSend(req *transport_interface.OutgoingLetter)

func (*Neighbour) InitDefault

func (c *Neighbour) InitDefault()

func (*Neighbour) Start

func (c *Neighbour) Start()

type PhysicalCommunicator

type PhysicalCommunicator struct {
	Port            int // listening port
	PrivateKey      core.PrivKey
	ProtocolId      string
	NetworkReporter performance.PerformanceReporter
	// contains filtered or unexported fields
}

PhysicalCommunicator

func (*PhysicalCommunicator) AddSubscriberNewIncomingMessageEvent

func (c *PhysicalCommunicator) AddSubscriberNewIncomingMessageEvent(sub transport_interface.NewIncomingMessageEventSubscriber)

func (*PhysicalCommunicator) AddSubscriberPeerConnectedEvent

func (c *PhysicalCommunicator) AddSubscriberPeerConnectedEvent(sub transport_interface.PeerConnectedEventSubscriber)

func (*PhysicalCommunicator) ClosePeer

func (c *PhysicalCommunicator) ClosePeer(id string)

func (*PhysicalCommunicator) Enqueue

func (*PhysicalCommunicator) GetNeighbour

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

func (*PhysicalCommunicator) GetPeerId

func (c *PhysicalCommunicator) GetPeerId(address string) (peerIds string, err error)

func (*PhysicalCommunicator) HandlePeerStream

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

func (*PhysicalCommunicator) InitDefault

func (c *PhysicalCommunicator) InitDefault()

func (*PhysicalCommunicator) Listen

func (c *PhysicalCommunicator) Listen()

func (*PhysicalCommunicator) Name

func (c *PhysicalCommunicator) Name() string

func (*PhysicalCommunicator) NewOutgoingMessageEventChannel

func (c *PhysicalCommunicator) NewOutgoingMessageEventChannel() chan *transport_interface.OutgoingLetter

func (*PhysicalCommunicator) Start

func (c *PhysicalCommunicator) Start()

func (*PhysicalCommunicator) Stop

func (c *PhysicalCommunicator) Stop()

func (*PhysicalCommunicator) SuggestConnection

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

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

Jump to

Keyboard shortcuts

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