length(scope, index = null) {
    const buf = this.getBuffer(scope, index);
    if (!buf) { return 0; }
    return buf.length;
  }
Returns the number of data packets in an inport
@param {string|null} scope
@param {number|null} [index]
@returns {number}