checkLimit method

  1. @override
String? checkLimit(
  1. GetConnLimiter limiter
)
override

Will return an error if the connection manager's internal connection limit exceeds the provided system limit.

Implementation

@override
String? checkLimit(GetConnLimiter limiter) {
  final limit = limiter.getConnLimit();
  final currentConnections = _connections.length;

  if (currentConnections > limit) {
    return 'Connection limit exceeded: $currentConnections connections, limit is $limit';
  }

  return null;
}