close method

dynamic close()

Implementation

close() {
  if (this._closed) return;

  logger.debug('close()');

  this._closed = true;
  this._connected = false;

  // close transport
  this._transport.close();

  // Close every pending sent.
  _sents.forEach((key, sent) {
    sent.close();
  });

  // Emit 'close' event.
  this.safeEmit('close');
}