register method

void register(
  1. WebSocketConnection connection
)

Registers a new connection into the hub.

Implementation

void register(WebSocketConnection connection) {
  _connections[connection.id] = connection;
  connection.socket.done.then((_) => _connections.remove(connection.id));
}