Documentation ¶
Index ¶
Constants ¶
View Source
const MaxLength = 25
MaxLength is the maximum number of items to keep in the RecentlySeen list.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PEXList ¶
type PEXList struct {
// contains filtered or unexported fields
}
PEXList contains the list of peer address for sending them to a peer at certain interval. List contains 2 separate lists for added and dropped addresses.
func NewWithRecentlySeen ¶ added in v1.8.10
func NewWithRecentlySeen(rs []tracker.CompactPeer) *PEXList
NewWithRecentlySeen returns a new PEXList with given peers added to the dropped part.
type RecentlySeen ¶ added in v1.8.10
type RecentlySeen struct {
// contains filtered or unexported fields
}
RecentlySeen is a peer address list that keeps the last `MaxLength` items.
func (*RecentlySeen) Add ¶ added in v1.8.10
func (l *RecentlySeen) Add(addr *net.TCPAddr)
Add a new address to the list.
func (*RecentlySeen) Len ¶ added in v1.8.10
func (l *RecentlySeen) Len() int
Len returns the number of addresses in the list.
func (*RecentlySeen) Peers ¶ added in v1.8.10
func (l *RecentlySeen) Peers() []tracker.CompactPeer
Peers returns the addresses in the list.
Click to show internal directories.
Click to hide internal directories.