install method

bool install({
  1. int threads = 2,
  2. int window = 8 << 20,
})

Starts the library's runtime (threads worker threads; only the first call per loaded library has an effect) and makes its transport the default for clients created afterwards. Returns false and changes nothing if the runtime could not start.

Implementation

bool install({int threads = 2, int window = 8 << 20}) {
  if (!_initialized) {
    _initialized = _init(NativeApi.postCObject.cast(), threads);
    if (!_initialized) return false;
  }
  WebSocketTransports.use(transport(window: window));
  return true;
}