validate method

  1. @override
bool validate({
  1. bool throwOnError = false,
})
override

Validates the configuration

Implementation

@override
bool validate({bool throwOnError = false}) {
  if (maxFrameBytes < 1024) {
    if (throwOnError) {
      throw ArgumentError.value(
        maxFrameBytes,
        'maxFrameBytes',
        'must leave room for a coordination message (at least 1024)',
      );
    }
    return false;
  }
  if (hubUri.scheme != 'ws' && hubUri.scheme != 'wss') {
    if (throwOnError) {
      throw ArgumentError.value(
        hubUri.toString(),
        'hubUri',
        'must use the ws:// or wss:// scheme',
      );
    }
    return false;
  }
  return true;
}