failNextConnect method
Makes the next connect throw error (by default a
WebSocketException "connection refused"), to test how the client
handles a refused connection. Each call fails one more attempt.
Implementation
void failNextConnect([Object? error]) =>
_failures.add(error ?? WebSocketException('connection refused'));