code: function(socket, options) {
      if(!options) {
          options = socket || {};
          socket = new net.Socket(options);
      }
  
      this.socket = socket;
      this.connected = options.connected || socket.writable && socket.readable || false;
  
      this.retry = {
          retries: 0,
          max: options.maxRetries || 10,
          interval: options.retryInterval || 5000,
          wait: options.retryInterval || 5000
      };
  
      this.$reconnect = options.reconnect || false;
      this.$options = options;
  
      this.$buff = null;
      this.$msg = null;
  
      EventEmitter.call(this, {
          delimiter: "::",
          wildcard: true,
          maxListeners: options.maxListeners || 10
      });
  
      this._setup();
  }
docs: ISocket
  @param {Socket} [socket] the socket object
  @param {Object} options the options
  @constructor