accept method

Attaches the accepted channel and starts protocol initialization.

Implementation

AcpWebSocketServerSession accept(AcpWebSocketChannel channel) {
  if (_settled) {
    _owner._trackCleanup(_owner._closeRejectedChannel(channel));
    throw StateError('ACP WebSocket upgrade has already been settled');
  }
  _settled = true;
  _expiryTimer.cancel();
  _owner._prepared.remove(this);
  return _owner._accept(channel, _connection);
}