addClientConnection method

  1. @protected
Channel addClientConnection(
  1. T info, [
  2. Channel? id
])

Implementation

@protected
Channel addClientConnection(T info, [Channel? id]) {
  if (id != null) {
    closeConnection(id);
  }
  final current = id ?? _findAvailableChannel();
  if (current == kAnyChannel) return current;
  _connections[current] = info;
  _connectController.add((current, info));
  _changeController.add(clientConnections);
  return current;
}