Documentation ¶
Overview ¶
- Copyright (C) 2018 The ontology Authors
- This file is part of The ontology library. *
- The ontology is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- The ontology is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details. *
- You should have received a copy of the GNU Lesser General Public License
- along with The ontology. If not, see <http://www.gnu.org/licenses/>.
Package p2p provides an network interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressFilter ¶
func AllAddrFilter ¶
func AllAddrFilter() AddressFilter
func CombineAddrFilter ¶
func CombineAddrFilter(filter1, filter2 AddressFilter) AddressFilter
func NoneAddrFilter ¶
func NoneAddrFilter() AddressFilter
type HostAddrDetected ¶
type HostAddrDetected struct { ListenAddr string // contains filtered or unexported fields }
type NetworkStart ¶
type NetworkStart struct {
// contains filtered or unexported fields
}
type NetworkStop ¶
type NetworkStop struct {
// contains filtered or unexported fields
}
type P2P ¶
type P2P interface { Connect(addr string) GetHostInfo() *peer.PeerInfo GetID() common.PeerId GetNeighbors() []*peer.Peer GetNeighborAddrs() []common.PeerAddr GetConnectionCnt() uint32 GetMaxPeerBlockHeight() uint64 GetPeer(id common.PeerId) *peer.Peer SetHeight(uint64) Send(p *peer.Peer, msg types.Message) error SendTo(p common.PeerId, msg types.Message) GetOutConnRecordLen() uint Broadcast(msg types.Message) IsOwnAddress(addr string) bool }
P2P represent the net interface of p2p package
type PeerConnected ¶
type PeerDisConnected ¶
type Protocol ¶
type Protocol interface { HandlePeerMessage(ctx *Context, msg types.Message) HandleSystemMessage(net P2P, msg SystemMessage) }
type SystemMessage ¶
type SystemMessage interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.