import Unicast from 'foglet-core/src/network/communication/unicast/unicast.js'
Unicast
Extends:
* → Unicast
Unicast represent the base implementation of an unicast protocol for the foglet library.
Constructor Summary
Public Constructor | ||
public |
constructor(source: AbstractNetwork, protocol: string) Constructor |
Member Summary
Private Members | ||
private |
_unicast: * |
Method Summary
Public Methods | ||
public |
Send a message to a peer using its ID. |
|
public |
sendMultiple(ids: string[], message: Object): Promise Send a message to multiple peers |
Private Methods | ||
private |
Handler executed when a message is recevied |
Public Constructors
public constructor(source: AbstractNetwork, protocol: string) source
Constructor
Params:
Name | Type | Attribute | Description |
source | AbstractNetwork | The source RPS/overlay |
|
protocol | string | The name of the unicast protocol |
Private Members
private _unicast: * source
Public Methods
public send(id: string, message: *): Promise source
Send a message to a peer using its ID. This peer must be a neighbour.
Params:
Name | Type | Attribute | Description |
id | string | The id to send the message |
|
message | * | The message to send |
public sendMultiple(ids: string[], message: Object): Promise source
Send a message to multiple peers