Documentation
¶
Index ¶
- type P2PServer
- func (this *P2PServer) Broadcast(message interface{})
- func (this *P2PServer) GetConnectionCnt() uint32
- func (this *P2PServer) GetConnectionState() uint32
- func (this *P2PServer) GetID() uint64
- func (this *P2PServer) GetNeighborAddrs() []common.PeerAddr
- func (this *P2PServer) GetNetWork() p2p.P2P
- func (this *P2PServer) GetPort() (uint16, uint16)
- func (this *P2PServer) GetTime() int64
- func (this *P2PServer) GetVersion() uint32
- func (this *P2PServer) Send(p *peer.Peer, msg msgtypes.Message, isConsensus bool) error
- func (this *P2PServer) Start(node *node.Node) error
- func (this *P2PServer) Stop() error
- func (this *P2PServer) TriggerSync(current_head_blk_id coomn.BlockID)
- type ReconnectAddrs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type P2PServer ¶
type P2PServer struct {
iservices.IP2P
Network p2p.P2P
ReconnectAddrs
// contains filtered or unexported fields
}
P2PServer control all network activities
func NewServer ¶
func NewServer(ctx *node.ServiceContext) (*P2PServer, error)
NewServer return a new p2pserver according to the pubkey
func (*P2PServer) GetConnectionCnt ¶
GetConnectionCnt return the established connect count
func (*P2PServer) GetConnectionState ¶
Todo: remove it if no use
func (*P2PServer) GetNeighborAddrs ¶
GetNeighborAddrs return all nbr`s address
func (*P2PServer) GetNetWork ¶
func (this *P2PServer) GetNetWork() p2p.P2P
GetNetWork returns the low level netserver
func (*P2PServer) GetVersion ¶
GetVersion return self version
func (*P2PServer) TriggerSync ¶
Click to show internal directories.
Click to hide internal directories.