Constructor
new Peer(configopt)
Create an instance of Peer.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
<optional> |
Initialization Vector for this peer.
Properties
|
- Source:
Members
address
- Deprecated:
-
- Yes
- Source:
Methods
_connect(target)
Open a Fabric connection to the target address and initiate the Fabric Protocol.
Parameters:
Name | Type | Description |
---|---|---|
target |
String | Target address. |
- Source:
_fillPeerSlots() → {Peer}
Attempt to fill available connection slots with new peers.
- Source:
Returns:
Instance of the peer.
- Type
- Peer
_handleFabricMessage(buffer) → {Peer}
Handle a Fabric Message buffer.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
Buffer |
- Source:
Returns:
Instance of the Peer.
- Type
- Peer
broadcast(message)
Write a Buffer to all connected peers.
Parameters:
Name | Type | Description |
---|---|---|
message |
Buffer | Message buffer to send. |
- Source:
(async) listen() → {Peer}
Start listening for connections.
- Source:
Returns:
Chainable method.
- Type
- Peer
(async) start()
Start the Peer.
- Source:
(async) stop()
Stop the peer.
- Source: