Cyclon
Extends:
Implementation of CYCLON: Inexpensive Membership Management for Unstructured P2P Overlays Spyros Voulgaris,1,2 Daniela Gavidia,1 and Maarten van Steen1 @article{voulgaris2005cyclon, title={Cyclon: Inexpensive membership management for unstructured p2p overlays}, author={Voulgaris, Spyros and Gavidia, Daniela and Van Steen, Maarten}, journal={Journal of Network and Systems Management}, volume={13}, number={2}, pages={197--217}, year={2005}, publisher={Springer} }
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public get |
partialView: * |
Private Members | ||
private |
_partialView: * |
|
private |
_periodic: * |
Method Summary
Public Methods | ||
public |
exchange(): * |
|
public |
Get k neighbors from the partial view. |
|
public |
Joining a network. |
Private Methods | ||
private |
|
|
private |
_exchange(): * |
|
private |
_getSample(size: *): * |
|
private |
_onArcDown(peerId: string | null) |
|
private |
_onBridge(from: *, to: *) |
|
private |
_onExchange(id: *, message: *) |
|
private |
_onJoin(id: *) |
|
private |
_onLeave(id: *) |
|
private |
_open(peerId: *) |
|
private |
|
|
private |
_start() |
|
private |
_stop() |
Public Constructors
public constructor() source
Public Members
public get partialView: * source
Private Members
private _partialView: * source
private _periodic: * source
Public Methods
public getPeers(k: number): string[] source
Get k neighbors from the partial view. If k is not reached, it tries to fill the gap with neighbors from the inview. It is worth noting that each peer controls its outview but not its inview. The more the neigbhors from the outview the better.
Params:
Name | Type | Attribute | Description |
k | number | The number of neighbors requested. If k is not defined, it returns every known identifiers of the partial view. |
public join(sender: callback): Promise source
Joining a network.
Params:
Name | Type | Attribute | Description |
sender | callback | Function that will be called each time an offer arrives to this peer. It is the responsability of the caller to send these offer (using sender) to the contact inside the network. |
Return:
Promise | A promise that is resolved when the peer joins the network -- the resolve contains the peerId; rejected after a timeout, or already connected state. |
Private Methods
private _close(peerId: string) source
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the removed arc. |
private _onBridge(from: *, to: *) source
Params:
Name | Type | Attribute | Description |
from | * | ||
to | * |
private _onExchange(id: *, message: *) source
Params:
Name | Type | Attribute | Description |
id | * | ||
message | * |
private _onJoin(id: *) source
Params:
Name | Type | Attribute | Description |
id | * |
private _onLeave(id: *) source
Params:
Name | Type | Attribute | Description |
id | * |
private _open(peerId: *) source
Params:
Name | Type | Attribute | Description |
peerId | * |