Class: PeerList

net.PeerList

new PeerList(options)

Peer List

Parameters:
Name Type Description
options Object
Source:

Methods

add(peer)

Add peer to list.

Parameters:
Name Type Description
peer Peer
Source:

destroy()

Destroy peer list (kills peers).

Source:

get(hostname) → {Peer}

Get peer by hostname.

Parameters:
Name Type Description
hostname String
Source:
Returns:
Type
Peer

has(hostname) → {Boolean}

Test whether a peer exists.

Parameters:
Name Type Description
hostname String
Source:
Returns:
Type
Boolean

Get the list head.

Source:
Returns:
Type
Peer

remove(peer)

Remove peer from list.

Parameters:
Name Type Description
peer Peer
Source:

size() → {Number}

Get list size.

Source:
Returns:
Type
Number

tail() → {Peer}

Get the list tail.

Source:
Returns:
Type
Peer