ArcStore
Table that contains all living sockets that might be in use. Peers can comprise multiples protocols that may use multiple times an arc.
Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
Check if the store has at least one occurrence of the peer. |
|
public |
Get the entry of the arc leading to PeerId |
|
public |
add another arc leading to peerId in the store |
|
public |
ProtocolId removes an arc to the peerId. |
|
public |
removes all arcs. |
|
public |
removePeer(peerId: string): Map Remove all arcs leading to peerId. |
Public Constructors
public constructor() source
Public Methods
public contains(peerId: string): boolean source
Check if the store has at least one occurrence of the peer.
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the peer to check. |
public get(peerId: string): ELiving source
Get the entry of the arc leading to PeerId
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the remote peer |
public insert(peerId: string, socket: object, tid: string): Boolean source
add another arc leading to peerId in the store
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the peer reachable through the socket. |
|
socket | object | The WebRTC socket. Can be null if the socket to peerId is known to be in the store. |
|
tid | string | TemporyId of a set of offer that we store in order to say if the already see a set of offers. (trickle true problems) |
public remove(peerId: string): ELiving source
ProtocolId removes an arc to the peerId.
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the peer accessible through the arc to delete. |
public removeAll(): object[] source
removes all arcs.
Return:
object[] | Objects comprising {peer, socket, occ}; peer being the identifier of the peer reachable through the socket, socket being a WebRTC connection that is not used by any protocols, null if protocols still use it, occ being the number of arcs removed by protocolId. |
public removePeer(peerId: string): Map source
Remove all arcs leading to peerId.
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the peer reachable by a WebRTC connection to remove. |
Return:
Map | Map where key is the identifier of the protocol that sees its arcs being removed, and value is the number of arcs removed; |