Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Close() error
- func (c *Client) EnqueueNotFoundPeer(id string)
- func (c *Client) HasNotFoundPeer(id string) bool
- func (c *Client) IsExpired(now, limit int64) bool
- func (c *Client) SendMessage(msg []byte) error
- func (c *Client) SendMsgVersion(version int) error
- func (c *Client) SetMT(mt int)
- func (c *Client) UpdateTs()
- type SignalVerResponse
Constants ¶
View Source
const (
MAX_NOT_FOUND_PEERS_LIMIT = 5
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Ws *websocket.Conn MessageType int PeerId string //唯一标识 LocalNode bool // 是否本地节点 Timestamp int64 NotFoundPeers []string // 记录没有找到的peer的队列 }
func (*Client) EnqueueNotFoundPeer ¶
func (*Client) HasNotFoundPeer ¶
func (*Client) SendMessage ¶
func (*Client) SendMsgVersion ¶
type SignalVerResponse ¶
Click to show internal directories.
Click to hide internal directories.