materialize method

Pointer<wt_server_config_t> materialize()

Applies the resolved settings to the native handle.

Implementation

Pointer<b.wt_server_config_t> materialize() {
  final bind = bindAddress;
  final address = bind == null ? nullptr : toNativeString(bind);
  try {
    checkStatus(
      b.wt_server_config_set_bind_address(_handle, address, port),
      'wt_server_config_set_bind_address',
    );
  } finally {
    if (address != nullptr) freeNativeString(address);
  }

  checkStatus(
    b.wt_server_config_set_allow_migration(_handle, allowMigration ? 1 : 0),
    'wt_server_config_set_allow_migration',
  );

  final idle = idleTimeout;
  if (idle != null) {
    checkStatus(
      b.wt_server_config_set_idle_timeout_ms(_handle, idle.inMilliseconds),
      'wt_server_config_set_idle_timeout_ms',
    );
  }
  final keep = keepAlive;
  if (keep != null) {
    checkStatus(
      b.wt_server_config_set_keep_alive_ms(_handle, keep.inMilliseconds),
      'wt_server_config_set_keep_alive_ms',
    );
  }

  final identity = this.identity;
  if (identity != null) _applyIdentity(identity);
  return _handle;
}