TODO: this is wired, not sure why need this
183827
public Object getNull(int i) {
        if(desc.get(i) != Cursor.FIELD_TYPE_NULL) {
            throw new IllegalStateException("The file type is not null.");
        }
        return null;
    }
355725
function connect() {
    let port = null;

    try {
      port = parseInt(readFileSync(path.join(
        datadir,
        'control-port'
      )).toString().split(':')[1]);
    } catch (err) {
      /* istanbul ignore next */
      portFileReads++;

      /* istanbul ignore next */
      if (portFileReads <= 20) {
        return setTimeout(() => connect(), 1000);
      } else {
        return controller.emit('error',
                               new Error('Failed to read control port'));
      }
    }

    socket.connect(port, '127.0.0.1');
  }
548745
function() {
		this.context = new AudioContext();
		this.sampleRate = this.context.sampleRate;
		this.gainNode = this.context.createGain();
		this.gainNode.connect( this.context.destination );
	}
349140
function(e, params) {
       this.options.container.onAddWire(e,params);

       this.disable();
       this.el.value = "[wired]";
    }
1118696
function(f) {
    this.socket = tls.connect(this.config.tcp, f);

    this.socket.on('secureConnect', function() {
      this.isConnected = true;
      if (this.retryCount > 1) {
        this.logger.info('Logmatic - reconnected.');
      } else {
        this.logger.debug('Logmatic - connected.');
      }
      this.retryCount = 0;

      while (this.messageBuffer.length) {
        this.sendMessage(this.messageBuffer.shift());
      }
    }.bind(this));

    this.socket.on('timeout', function() {
      this.logger.warn('Logmatic - connection timed out.');
    });

    this.socket.on('error', this.logger.error.bind(this.logger));

    this.socket.on('close', function() {
      this.isConnected = false;
      this.retryCount++;

      if(this.retryCount > 1) {
        setTimeout(function() {
          this.connect();
        }.bind(this), this.config.retryTimeout);
        this.logger.error('Logmatic - failling to reconnect', this.retryCount);
      } else {
        this.connect();
        this.logger.debug('Logmatic - connection closed.');
      }
    }.bind(this));
  }
252588
function init(entry, socket, req) {  // {{{2
/**
 * Class constructor
 *
 * @param entry {Object} Entry of xorg kind
 *
 * @method constructor
 */

  this.entry = entry;

  O.link.open(this, socket);
}
673380
function(event, args) {
      var wire = args[0];
      // add the wire to the list if it isn't in
      if( WireIt.indexOf(wire, this.wires) == -1 ) {
         this.wires.push(wire);
         this.eventAddWire.fire(wire);
      } 
   }
20066
public TinyBus wire(Wireable wireable) {
		assertObjectAndWorkerThread(wireable);
		Context context = mImpl.getNotNullContext();

		if (mWireables == null) {
			mWireables = new ArrayList<Wireable>();
		}
		mWireables.add(wireable);
		
		wireable.onCreate(this, context.getApplicationContext());
		wireable.assertSuperOnCreateCalled();
		
		if (context instanceof Application 
				|| context instanceof Service) {
			wireable.onStart();
		}

        // TODO, what to do with already started activity?
		return this;
	}
901478
function addConnection(conn) {

  this.emit('connect');

  function onInput(len) {
    this._stats.ibytes += len;
  }

  function onOutput(len) {
    this._stats.obytes += len;
  }

  conn.on('input', onInput.bind(this));
  conn.on('output', onOutput.bind(this));

  this._conn.push(conn);

  // pubsub needs to know the client index
  // to be able to quickly find client subscribers
  conn.client.index = this._conn.length - 1;
}
938509
function(){
        this._context = context;
        this._gainNode = context.createGain ? context.createGain() : context.createGainNode();
        this._gainNode.connect(context.destination);

        this._onAudioEvent = this._onAudioEvent.bind(this);
        this._onDecodeComplete = this._onDecodeComplete.bind(this);
        this._onDecodeError = this._onDecodeError.bind(this);
    }
1313175
def use(self, tube):
        
        with self._sock_ctx() as socket:
            if self.current_tube != tube:
                self.desired_tube = tube
                self._send_message('use {0}'.format(tube), socket)
                self._receive_name(socket)
                self.current_tube = tube
218423
function Connection(conn) {
	if(!(this instanceof Connection)) {
		return new Connection(conn);
	}
	var self = this;
	if(!conn) { throw new TypeError("no connection set"); }
	self._connection = conn;
}
744979
function RtcConnector(config) {

  this.config = config || {};
  this.config.eventPath = this.config.eventPath || '/rtcomm/event';
  this.key = "";
  this.id = generateUUID();
  this.unique = (config && config.unique) || false;
  this.connected = false;
  /* The internal list of filters */
  var myFilters = {} ;
  /* mqttClient object */

  var mqttClient = null;
  /**
   * createMqttClient - create MQTT client
   * @private
   * @param {Object} config  
   */
  var createMqttClient = function(config) {
  
    //console.log('RtcConnector: createMqttClient: server:  '+ config.server);

     var client = mqtt.connect(config.server + ':' + config.port);
     client.on('message', function(topic, message) {
       /*
        * This is called when a topic matching a valid subsription is received
        *   We have a valid subscription somewhere... 
        *   TODO:  This must call the filter FOR the topic and ensure it hasn't already
        *   been called.  
        */
       l('MESSAGE') && console.log('RtcConnector.mqttClient - Received Message on topic: '+topic);
        try {
          doFilter(topic,message);
        } catch(e) {
          console.error('MqttClient Message callback chain failure:',e);
          console.log(e.stack);
        }
      });
    client.on('connect', function(error) {
      console.log('RtcConnector: mqtt is CONNECTED');
      this.connected = true;
      this.emit('connected');
    }.bind(this));
    client.on('error', function(error) {
      console.log('RtcConnector: DISCONNECTED - error:'+ error);
      this.connected = false;
      this.emit('disconnected', error);
    }.bind(this));
    client.on('close', function(error) {
      console.log('RtcConnector: DISCONNECTED - close: '+error);
      this.connected = false;
      this.emit('disconnected',error);
    }.bind(this));
    return client;
  };

  /**
   * doFilter - Execute the filter callbacks for the topic passed
   * @private
   * @param {String} topic  Topic name to filter 
   * @param {String} message Message to pass
   */
  var doFilter = function(topic, message) {
    /*
     * so should a filter manage the last message it has?  and give it an ID and store it... 
     * to prevent duplicates...
     * or should this filter do it...
     * this shold just execute 1 filter -- NO more than 1.  But if a topic matches
     * multiple filters then we need to call one filter and mark it dirty or something
     *
     * maybe save the lastMessage w/ a timestamp and if it matches, then skip it... 
     *
     * given topic A that matches 2 filters so there will be 2 messages... 
     *
     *
     * return number of matches...
     * 
     *
     */

    for( var key in myFilters) {
      if (myFilters.hasOwnProperty(key)) {
        myFilters[key].doFilter(topic,message) ;
      }
    }
    // count is how many times filter ran... 
  };
  /**
   * init - Initialize the RtcConnector
   */
  this.start = function start() {
    if (this.config !== {} ) {
      mqttClient = mqttClient || createMqttClient.call(this,this.config);
      l('DEBUG') && console.log(this+'Using mqttClient: '+ mqttClient.options.clientId);
    } else {
      throw new Error('Config should have been passed during instantiation of RtcConnector');
    }
  };
/** 
 * stop the RtcConnector
 */
  this.stop = function stop() {
    // Stop any Filters, end our client... 
    this.destroy();
  };

  this.destroy = function destroy() {
 
    for( var key in myFilters) {
      if (myFilters.hasOwnProperty(key)) {
        myFilters[key].stop() ;
      }
    }
    mqttClient && mqttClient.end();
	
	if (rtcConnectors[this.id]){
		delete rtcConnectors[this.id];
	}
  };

  /**
   * Add a filter to the RtcConnector
   *
   * @param {Object} [config]  
   * @param {String} [config.eventPath]  EventPath topic server emits events on
   * @param {Object} [config.category]  
   * @param {Boolean} [config.category.session]  
   * @param {Object} [config.action]  
*  @param {String} [config.type]   One of 'start'|'stopped'|'modified'   
 * @param {Boolean} [config.type.started]  
 * @param {Boolean} [config.type.failed]  
 * @param {Boolean} [config.type.modified]  
 * @param {Boolean} [config.type.stopped]  
 * @param {String}  [config.toendpointid] 
 * @param {String}  [config.fromendpointid] 
   * @param {Function} filterFunction 
   */
  this.addFilter = function(filter,filterFunction) {
      filter.eventPath = this.config.eventPath;
      var f = new Filter(filter);
      f.callback = filterFunction || function(message) {
        //console.log('Filter for subscription called, but no callback -- OVERRIDE!');
      };
      f.dependencies.mqttClient = mqttClient;
      myFilters[f.id] = f;
      if (mqttClient) {
        f.start(mqttClient);
      //  console.log('Added Filter: ', f);
        return f;
      } else {
        console.log('No MQTT Client setup');
        return f;
      }
  };
  /**
  * Remove a filter
  * @param {@module:rtcomm/EventModule.Filter} filter Filter Object to remove
  */
  this.removeFilter = function(filter) {
    if (filter) {
     filter.stop();
     delete myFilters[filter.id];
     return true;
    } else {
      return false;
    }
  };
  /**
  * Add a filter for all events
  * @param {Function} filterFunction callback to execute when Filter is matched
  */
  this.allEventFilter = function(filterFunction) {
    return this.addFilter({},filterFunction);
  };

  /**
  * Add a filter for all events to/from a particular endpointid
  *
  * @param {String} endpointid 
  * @param {Function} filterFunction callback to execute when Filter is matched
  */
  this.allEndpointEvents = function(endpointid, filterFunction) {
    if (typeof endpointid !== 'function') {
      return this.addFilter({'toendpointid':endpointid, 'fromendpointid': endpointid},filterFunction);
    }
  };

  /**
  * Add a filter for all Presence events
  * @param {Function} filterFunction callback to execute when Filter is matched
  */
  this.allPresenceEvents = function(filterFunction){
      return this.addFilter({'type': true ,'state': true,'alias': true,'userDefines': true},filterFunction);
  };

  /**
  * Add a filter for all Session events
  * @param {Function} filterFunction callback to execute when Filter is matched
  */
  this.allSessionEvents = function(filterFunction) {
    return this.addFilter({'category':'session'},filterFunction);
  };

}
260071
function() {

      var wrapper = inputEx.cn('div', {className: 'WireIt-InputExTerminal'});
      this.divEl.insertBefore(wrapper, this.fieldContainer);

      this.terminal = new WireIt.Terminal(wrapper, {
         name: this.options.name, 
         direction: [-1,0],
         fakeDirection: [0, 1],
         ddConfig: {
            type: "input",
            allowedTypes: ["output"]
         },
      nMaxWires: 1 }, this.options.container);

      // Reference to the container
      if(this.options.container) {
         this.options.container.terminals.push(this.terminal);
      }

      // Register the events
      this.terminal.eventAddWire.subscribe(this.onAddWire, this, true);
      this.terminal.eventRemoveWire.subscribe(this.onRemoveWire, this, true);
    }
939586
function () {
    var i
    this.write = this.sendWrite
    for (i = 0; i < this._buffer.length; i++) this.write(this._buffer[i])
    this._buffer.length = 0
    return this
  }
956966
function connect () {
  // connection
  if (!alreadyConnectedOnce) {
    if (connectedPromise === null) connection = createConnection()
    var url = AppConfig.apiUrl + 'websocket/chat'
    if (accessToken) {
      token = accessToken
      url += '?access_token=' + accessToken
    }
    socket = new SockJS(url)
    stompClient = webstomp.over(socket)
    // stompClient.debug = null
    console.tron.log(`Connecting to ${url}`)
    var headers = {}
    stompClient.connect(headers, onConnect, onError)
    alreadyConnectedOnce = true
  }
}
973272
function Mesh(options){
	var self = this;
	EventEmitter.call(this);
	options = options || {};

	if(!options.wire){
		throw new Error('a mesh needs a wire')
	}
	this.wire = options.wire;
	this.router = options.router;
	this.route = options.route;
	this.mode = options.mode;

	this.wiresend = _.bind(this.wire.send, this.wire);
	this.wire.setup();

	this.connected = {};
	this.available = {};

	var initial = this.router.search(this.route || '');

	_.each(initial.workers, function(worker){
		self.addworker(worker);
	})

	
	this.router.on('added.' + this.route, function(route, worker){
		self.addworker(worker);
		self.emit('added', route, worker);
	})

	this.router.on('removed.' + this.route, function(route, worker){
		self.removeworker(worker);
		self.emit('removed', route, worker);
	})
}