closeGateway method

void closeGateway(
  1. int code, {
  2. String? reason,
  3. Duration? after,
})

Closes every gateway connection with code and reason, now or after a delay.

Implementation

void closeGateway(int code, {String? reason, Duration? after}) {
  if (after == null) {
    _gateway.closeAll(code, reason);
    return;
  }
  _timers.add(Timer(after, () => _gateway.closeAll(code, reason)));
}