Documentation ¶
Index ¶
Constants ¶
View Source
const ( //TIME_PEER_INFO_EXCHANGE get peer info timer, second TIMER_PEER_EXCHANGE = 5 MAX_REQ_COUNT = 10 )
DO NOT EDIT
View Source
const ( //TIME_DISCOVER connect to unknow peer, second TIME_DISCOVER = 5 //NEIGHBOR_DISCOVER_COUNT NEIGHBOR_DISCOVER_COUNT = 10 )
DO NOT EDIT
View Source
const ( //TIME_KEEP_LIVE ping/pong timer, second TIMER_KEEP_LIVE = 10 //TIMER_CHECK time out second TIMER_CHECK = 40 )
DO NOT EDIT
View Source
const ( TIME_FAST_PNE_EXCHANGE = 8 //TIME_PNE_EXCHANGE time to exchange peer neighbor info, minute TIME_PNE_EXCHANGE = 30 )
DO NOT EDIT
View Source
const ( PEER_INFO_REQ = 1 PEER_INFO_RSP = 2 PEER_HANDSHAKE_REQ = 3 PEER_HANDSHAKE_RSP = 4 PEER_HANDSHAKE_RSP_ACK = 5 PEER_NEIGHBOR_REQ = 7 PEER_NEIGHBOR_RSP = 8 PEER_PING = 9 PEER_PONG = 10 )
DO NOT EDIT
View Source
const (
MAX_PEER_COUNT = 100
)
DO NOT EDIT
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discover ¶
type Discover struct {
// contains filtered or unexported fields
}
Discover p2p protocol
func MakeDiscover ¶
MakeDiscover create instance
func (*Discover) SetSendupCallback ¶
SetSendupCallback set sendup callback
type PeerNeighborRsp ¶
PeerNeighborRsp pne exchange response
Click to show internal directories.
Click to hide internal directories.