Home Reference Source

lib/entries/epending.js

'use strict'

/**
 * Entry of the pending table containing sockets being created.
 */
class EPending {
  /**
     * @param {string} temporaryId A temporary id used to retrieve the entry.
     * @param {string} peerId The identifier of the peer reachable through the
     * socket. Null if the peerId is yet to be known.
     * @param {string} protocolId The identifier of the protocol that wishes to
     * establish the connexion.
     * @param {object} socket The WebRTC socket.
     * @param {number} timeout Maximum time for a connexion to establish.
     */
  constructor (temporaryId, peerId, socket, timeout) {
    this.tid = temporaryId // key
    this.peer = peerId
    this.socket = socket
    this.successful = false
    this.alreadyExists = false
    this.timeout = timeout
  };
};

module.exports = EPending