Class: Pinger

pinger~Pinger(sessionId, network, periodPings, numberPings, proactive)

Implements the logic of the first negotiation phase.

Constructor

new Pinger(sessionId, network, periodPings, numberPings, proactive)

Constructor
Parameters:
Name Type Description
sessionId Number The id of the session
network ClientNetwork | ServerNetwork Network object
periodPings Number Period in ms
numberPings Number Number of pings
proactive Boolean Should this pinger be the first
Source:

Members

isActive :Boolean

This property describes whether this pinger is currently running or it is not active. It means that the listeners are bound to the network.
Type:
  • Boolean
Source:

localMeas :Measure

The current local created measures.
Type:
  • Measure
Source:

network :ClientNetwork|ServerNetwork

Network object which emits events with the messages. Can be used both client and server network objects.
Type:
  • ClientNetwork | ServerNetwork
Source:

numberPings :Number

Number of PING requests to be generated.
Type:
  • Number
Source:

periodPings :Number

Time between outbound pings requests. In ms.
Type:
  • Number
Source:

proactive :Boolean

Tells whether this pinger should start to send requests after start or to wait to recieve the first ping and then start its own Pings.
Type:
  • Boolean
Source:

recieveTime :Array

Array containing the arriving time of the Responses for the requests.
Type:
  • Array
Source:

reporMeas :Measure

The reported measures from the other endpoint.
Type:
  • Measure
Source:

reqTime :Array

Array containing the arriving time of the recieved Requests.
Type:
  • Array
Source:

sendingTime :Array

Array containing the kickout time for Ping requests
Type:
  • Array
Source:

sequence :Number

The sequence number which is included in every Request.
Type:
  • Number
Source:

sessionId :Number

Session id of the session. It is included in every request
Type:
  • Number
Source:

timer :NanoTimer

Timer
Type:
  • NanoTimer
Source:

Methods

(static) genClient(sessionId, network, periodPings, numberPings) → {Pinger}

Generates a new pinger with Client settings.
Parameters:
Name Type Description
sessionId Number The id of the session
network ClientNetwork | ServerNetwork Network object
periodPings Number Period in ms
numberPings Number Number of pings
Source:
Returns:
Type
Pinger

(static) genServer(sessionId, network, periodPings, numberPings) → {Pinger}

Generates a new pinger with Server settings.
Parameters:
Name Type Description
sessionId Number The id of the session
network ClientNetwork | ServerNetwork Network object
periodPings Number Period in ms
numberPings Number Number of pings
Source:
Returns:
Type
Pinger

measure() → {Promise.<Object>}

Star the measurement stage. It will resolve the promise with the obtained measures and the last reported metrics from the other end. May reject if someone cancels the measure.
Source:
Returns:
The measures obtained.
Type
Promise.<Object>

stop()

Stop the pinger. If there is a measure ongoing there will not be any action, if a measure is going it will stop abruptly. it resets the pinger for another measure.
Source: