code: function (events) {
    // configure the marionette socket
    this.socket = new net.Socket();
    this.socket.on('error', this._onError.bind(this));
    this.socket.on('data', this._onData.bind(this));
  
    // configure marionette session container
    this._marionetteID = null;
  
    // store events instance
    this.events = events;
  
    // register marionette id setter
    this.events.on('marionette:setMarionetteID', function (id) {
      this._marionetteID = id;
    }.bind(this));
  
    // prepare the commands property
    this.commands = {};
  
    // prepare the last send command property
    this._lastCommand = null;
  
    // prepare the last message length property
    this._lastMessageLength = null;
  
    // load the commands
    this._loadCommands();
  }
docs: Firefox Autotest (Marionette)
  connection handler & request executor
  
  @module FirefoxDriver
  @class Marionette
  @namespace FirefoxDriver
   
  Configures the marionette socket
  Prepares the object properties
  Loads the marionette commands
  
  @constructor
  @param {EventEmitter} events