code: function listen (conn) {
    if (conn._listening) return;
    conn._listening = true;
  
    conn.db.on('close', function(){
      if (conn._closeCalled) return;
  
      // the driver never emits an `open` event. auto_reconnect still
      // emits a `close` event but since we never get another
      // `open` we can't emit close
      if (conn.db.serverConfig.autoReconnect) {
        conn.readyState = STATES.disconnected;
        conn.emit('close');
        return;
      }
      conn.onClose();
    });
    conn.db.on('error', function(err){
      conn.emit('error', err);
    });
    conn.db.on('reconnect', function() {
      conn.readyState = STATES.connected;
      conn.emit('reconnected');
    });
    conn.db.on('timeout', function(err){
      var error = new Error(err && err.err || 'connection timeout');
      conn.emit('error', error);
    });
    conn.db.on('open', function (err, db) {
      if (STATES.disconnected === conn.readyState && db && db.databaseName) {
        conn.readyState = STATES.connected;
        conn.emit('reconnected');
      }
    });
    conn.db.on('parseError', function(err) {
      conn.emit('parseError', err);
    });
  }
docs: /*!
  Register listeners for important events and bubble appropriately.