close method

void close()

Implementation

void close() {
  _serverSocketA?.close();
  _serverSocketA = null;

  _serverSocketB?.close();
  _serverSocketB = null;

  if (!_closedCompleter.isCompleted) {
    _closedCompleter.complete();
    _log('closed');
  }
  for (final s in pendingA) {
    _closeSide(s);
  }
  pendingA.clear();
  for (final s in pendingB) {
    _closeSide(s);
  }
  pendingB.clear();
}