Documentation ¶
Index ¶
- Constants
- Variables
- type IoEvent
- type Neighbour
- type PhysicalCommunicator
- func (c *PhysicalCommunicator) AddSubscriberNewIncomingMessageEvent(sub transport_interface.NewIncomingMessageEventSubscriber)
- func (c *PhysicalCommunicator) AddSubscriberPeerConnectedEvent(sub transport_interface.PeerConnectedEventSubscriber)
- func (c *PhysicalCommunicator) ClosePeer(id string)
- func (c *PhysicalCommunicator) Enqueue(req *transport_interface.OutgoingLetter)
- func (c *PhysicalCommunicator) GetNeighbour(id string) (neighbour *Neighbour, err error)
- func (c *PhysicalCommunicator) GetPeerId(address string) (peerIds string, err error)
- func (c *PhysicalCommunicator) HandlePeerStream(s network.Stream)
- func (c *PhysicalCommunicator) InitDefault()
- func (c *PhysicalCommunicator) Listen()
- func (c *PhysicalCommunicator) Name() string
- func (c *PhysicalCommunicator) NewOutgoingMessageEventChannel() chan *transport_interface.OutgoingLetter
- func (c *PhysicalCommunicator) Start()
- func (c *PhysicalCommunicator) Stop()
- func (c *PhysicalCommunicator) SuggestConnection(address string) (peerIds string)
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 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()
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 (c *PhysicalCommunicator) Enqueue(req *transport_interface.OutgoingLetter)
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.
Click to show internal directories.
Click to hide internal directories.