lib/managers/broadcast.js
function UdpBroadcastManager(options) {
  if (!(this instanceof UdpBroadcastManager)) {
    return new UdpBroadcastManager(options);
  }

  options = options || {};

  Manager.call(this, options);

  debug('New UdpBroadcastManager: %j', options);

  this.dgramType = options.dgramType ? String(options.dgramType).toLowerCase() : Defaults.DGRAM_TYPE;
  this.port = options.port || Defaults.PORT;
  this.address = options.address || null;
  this.multicastAddress = options.multicastAddress || Defaults.MULTICAST_ADDRESS;

  this.interval = options.interval || Defaults.INTERVAL;
  this.timeout = options.timeout || this.interval * 2.5;

  this._timeoutTimerIds = {};
  this._announceTimerId = null;

  this._initSocket();
  this._startAnnouncements();
}
function UdpBroadcastManager(options) {
  if (!(this instanceof UdpBroadcastManager)) {
    return new UdpBroadcastManager(options);
  }

  options = options || {};

  Manager.call(this, options);

  debug('New UdpBroadcastManager: %j', options);

  this.dgramType = options.dgramType ? String(options.dgramType).toLowerCase() : Defaults.DGRAM_TYPE;
  this.port = options.port || Defaults.PORT;
  this.address = options.address || null;
  this.multicastAddress = options.multicastAddress || Defaults.MULTICAST_ADDRESS;

  this.interval = options.interval || Defaults.INTERVAL;
  this.timeout = options.timeout || this.interval * 2.5;

  this._timeoutTimerIds = {};
  this._announceTimerId = null;

  this._initSocket();
  this._startAnnouncements();
}
function UdpBroadcastManager ( options ) { if ( ! ( this instanceof UdpBroadcastManager ) ) { return new UdpBroadcastManager ( options ) ; } options = options || { } ; Manager . call ( this , options ) ; debug ( 'New UdpBroadcastManager: %j' , options ) ; this . dgramType = options . dgramType ? String ( options . dgramType ) . toLowerCase ( ) : Defaults . DGRAM_TYPE ; this . port = options . port || Defaults . PORT ; this . address = options . address || null ; this . multicastAddress = options . multicastAddress || Defaults . MULTICAST_ADDRESS ; this . interval = options . interval || Defaults . INTERVAL ; this . timeout = options . timeout || this . interval * 2.5 ; this . _timeoutTimerIds = { } ; this . _announceTimerId = null ; this . _initSocket ( ) ; this . _startAnnouncements ( ) ; }
Creates a new instance of UdpBroadcastManager with the provided `options`.

The UdpBroadcastManager provides a client connection to the
zero-configuration, UDP-based discovery system that is used by Discovery
by default. Because it requires zero configuration to use, it's ideal for
initial exploration and development. However, it's not expected to work
at-scale, and should be replaced with the included HTTP-based version.

For more information, see the README.

@param {Object} options
Creates a new instance of UdpBroadcastManager with the provided options .