close method

void close([
  1. bool noreplyWait = true
])

Implementation

void close([bool noreplyWait = true]) {
  // ignore: unnecessary_null_comparison
  if (_socket != null) {
    if (noreplyWait) this.noreplyWait();
    try {
      _socket!.close();
    } catch (err) {
      // TODO: do something with err.
    }

    _socket!.destroy();
    _socket = null;
  }
}