UNPKG

diffusion

Version:

Diffusion JavaScript client

29 lines (27 loc) 1.19 kB
var _interface = require('util/interface')._interface; module.exports = _interface('Pings', [ /** * Send a ping request to the server. * <P> * The main purpose of a ping is to test, at a very basic level, the current network conditions that exist between * the client session and the server it is connected to. The ping response includes the time taken to make a * round-trip call to the server. * <P> * There are no permission requirements associated with this feature. * * @example * session.pingServer(function(pingDetails) { * console.log("Round-trip call to server took: " + pingDetails.rtt + "milliseconds"); * }); * * @return {Result<Session.PingDetails>} a result that completes when a response is received from the server. * @function Session#pingServer */ 'pingServer' /** * @typedef {Object} Session.PingDetails * @property {Number} timestamp - The timestamp when the ping was sent, represented as milliseconds since epoch * @property {Number} rtt - The round-trip time in milliseconds from when the ping was sent to the time the response * was received */ ]);