code: function Socket(/* [options] */) {
      events.EventEmitter.call(this);
      var self = this;
  
      // Socket
      if (arguments[0] instanceof net.Socket) {
          this._socket = arguments[0];
      } else {
          var options = arguments[0] || {};
          this._socket = new net.Socket(options);
      }
      
      // Configuration
      this.signature = 174021652;
  
      // Read data
      this._buffers = [];
      this._offset = 0;            // Current offset in the first buffer    
      this._length = 0;            // Sum of all buffers minus offset
      this._messageLength = null;
  
      // Write data
      this._header = new Buffer(8);
      this._header.writeUInt32BE(this.signature, 0);
  
      // Event handlers
      this._socket.on('data', this.onData.bind(this));
  
      // Relay some of the socket events that don't need to be handled
      [   'connect',
          'end',
          'close',
          'timeout',
          'drain',
          'error'
      ].forEach(function (event) {
          self._socket.on(event, function (data) {
              self.emit(event, data);
          });
      });
  
      // Relay some of the socket properties that don't need to be handled
      [   'remoteAddress',
          'remotePort',
          'bytesRead',
          'bytesWritten',
          'bufferSize'
      ].forEach(function (propertyName) {
          Object.defineProperty(self, propertyName, {
              get: function () {
                  return self._socket[propertyName];
              },
              enumerable: true
          });
      });
  
      // Relay some of the socket functions that don't need to be handled
      [   'connect',
          'destroy',
          'pause',
          'resume',
          'setTimeout',
          'setNoDelay',
          'setKeepAlive',
          'address'
      ].forEach(function (functionName) {
          self[functionName] = function () {
              return self._socket[functionName].apply(self._socket, arguments);
          };
      });
  }
docs: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Socket