OnboardOptions class
Options of Runtime.Onboard. Choose exactly one mode; the last call wins:
OnboardOptions.UseLocalApp for an app on the hub's PC (also an app QAROS launched, and an
app on a member hub's PC after Runtime.JoinHubAsMember), or
OnboardOptions.UseInvite for a companion process of such an app.
Namespace: Quaternar.Qaros · Assembly: Quaternar.Qaros.dll
public sealed class OnboardOptions
Properties
OnboardingId
Deprecated: an id an earlier onboard returned re-enrolls that persisted slot. Leave it unset.
[Obsolete("Re-enrolling a persisted identity slot is deprecated: leave OnboardingId unset and onboard with OnboardOptions.UseLocalApp or OnboardOptions.UseInvite.")]
public OnboardingId? OnboardingId { get; set; }
Value: OnboardingId?
Presentation
public PeerPresentationOptions? Presentation { get; set; }
Value: PeerPresentationOptions
Methods
| Member | Description |
|---|---|
| WithPresentation(PeerPresentationOptions) | |
| UseCode(string) | Onboards with a pairing code: a short code minted for the hub's operators (the QAROS Visualizer shows none: its hub join code is for another hub only), or an addressed code (qar-code:...) given by hand. Without OnboardOptions.WithHost it finds this user's hub on this PC by itself. |
| UseInvite(OnboardingInvite) | Onboards a companion process (co-process) of an app: the app calls Session.RequestOnboardingInvite once per app session and hands the OnboardingInvite.Serialize bytes to the companion, which turns them back with OnboardingInvite.Deserialize and onboards with them on a runtime created with RuntimeOptions.EphemeralStorage. No discovery, no code. |
| UseLocalApp(OnboardLocalApp?) | Join the QAROS hub on this PC as a local source app: no code, nothing persisted. The default for a source app running next to the hub. Replaces an earlier mode. |
| WithHost(string, ushort) | Code onboarding against the hub at hostname:port. The port is required: hubs claim their onboarding port from a range, so there is no default. Without WithHost, code onboarding finds this user's hub on its own. Deprecated with OnboardOptions.UseCode. |
| WithPeerId(PeerId) | Deprecated: join the session under peerId instead of a fresh id; it is persisted with the slot and kept by every later rejoin. Not with OnboardOptions.UseLocalApp: the hub picks a local app's peer id, and a companion joining with OnboardOptions.UseInvite keeps the peer id bound to its app tag. |
| WithGraphicsDevice(GraphicsDeviceId) | Create the session's GPU devices on this adapter. |
| WithoutGraphicsDevice() | Create the session without a graphics device, for an application that never streams media (a companion that only drives app volumes, GUI panels or peers): it starts faster, and its media streaming calls fail with StatusCode.GraphicsDeviceNotInitialized. See GraphicsDeviceDisabled. Not together with OnboardOptions.WithGraphicsDevice. |
| WithExtension(Structure) |
WithPresentation
public OnboardOptions WithPresentation(PeerPresentationOptions presentation)
Parameters
| Name | Type | Description |
|---|---|---|
presentation | PeerPresentationOptions |
Returns: OnboardOptions
UseCode
Onboards with a pairing code: a short code minted for the hub's operators (the QAROS
Visualizer shows none: its hub join code is for another hub only), or an
addressed code (qar-code:...) given by hand. Without
OnboardOptions.WithHost it finds this user's hub on this PC by itself.
[Obsolete("Code onboarding is deprecated: use OnboardOptions.UseLocalApp for an app on the hub's PC, or OnboardOptions.UseInvite with an invite from Session.RequestOnboardingInvite for a companion process.")]
public OnboardOptions UseCode(string code)
Parameters
| Name | Type | Description |
|---|---|---|
code | string |
Returns: OnboardOptions
Remarks
Deprecated: use OnboardOptions.UseLocalApp, or OnboardOptions.UseInvite for a companion
process. The code is a secret: do not log it or pass it on a command line. Replaces an
earlier mode, including a OnboardOptions.WithHost made before this call.
UseInvite
Onboards a companion process (co-process) of an app: the app calls
Session.RequestOnboardingInvite
once per app session and hands the OnboardingInvite.Serialize bytes to
the companion, which turns them back with OnboardingInvite.Deserialize and
onboards with them on a runtime created with RuntimeOptions.EphemeralStorage.
No discovery, no code.
public OnboardOptions UseInvite(OnboardingInvite invite)
Parameters
| Name | Type | Description |
|---|---|---|
invite | OnboardingInvite |
Returns: OnboardOptions
Remarks
The invite stays valid while the app's session lives, so a restarted companion onboards with the same bytes. One onboard call retries by itself (250 ms doubling to 5 s) while the app or the hub is away, until it joins, is cancelled, or fails for good (a forged invite, a denied approval, the app's session gone): bound it with a cancellation token.
The invite is borrowed: the caller keeps ownership and must not dispose it before the onboard call has completed. Replaces an earlier mode.
UseLocalApp
Join the QAROS hub on this PC as a local source app: no code, nothing persisted. The default for a source app running next to the hub. Replaces an earlier mode.
public OnboardOptions UseLocalApp(OnboardLocalApp? localApp = null)
Parameters
| Name | Type | Description |
|---|---|---|
localApp | OnboardLocalApp |
Returns: OnboardOptions
WithHost
Code onboarding against the hub at hostname:port.
The port is required: hubs claim their onboarding port from a range, so there is no
default. Without WithHost, code onboarding finds this user's hub on its own.
Deprecated with OnboardOptions.UseCode.
[Obsolete("Code onboarding is deprecated: use OnboardOptions.UseLocalApp for an app on the hub's PC, or OnboardOptions.UseInvite with an invite from Session.RequestOnboardingInvite for a companion process.")]
public OnboardOptions WithHost(string hostname, ushort port)
Parameters
| Name | Type | Description |
|---|---|---|
hostname | string | |
port | ushort |
Returns: OnboardOptions
Exceptions
| Exception | Condition |
|---|---|
| InvalidOperationException | The mode is an invite (OnboardOptions.UseInvite). |
WithPeerId
Deprecated: join the session under peerId instead of a fresh id;
it is persisted with the slot and kept by every later rejoin. Not with
OnboardOptions.UseLocalApp: the hub picks a local app's peer id, and a companion
joining with OnboardOptions.UseInvite keeps the peer id bound to its app tag.
[Obsolete("A planned peer id is deprecated: use OnboardOptions.UseLocalApp (the hub picks the peer id) or OnboardOptions.UseInvite (the invite's app tag keeps the peer id).")]
public OnboardOptions WithPeerId(PeerId peerId)
Parameters
| Name | Type | Description |
|---|---|---|
peerId | PeerId |
Returns: OnboardOptions
WithGraphicsDevice
Create the session's GPU devices on this adapter.
public OnboardOptions WithGraphicsDevice(GraphicsDeviceId graphicsDevice)
Parameters
| Name | Type | Description |
|---|---|---|
graphicsDevice | GraphicsDeviceId |
Returns: OnboardOptions
WithoutGraphicsDevice
Create the session without a graphics device, for an application that never streams
media (a companion that only drives app volumes, GUI panels or peers): it starts faster,
and its media streaming calls fail with
StatusCode.GraphicsDeviceNotInitialized. See
GraphicsDeviceDisabled. Not together with OnboardOptions.WithGraphicsDevice.
public OnboardOptions WithoutGraphicsDevice()
Returns: OnboardOptions
WithExtension
public OnboardOptions WithExtension(Structure extension)
Parameters
| Name | Type | Description |
|---|---|---|
extension | Structure |
Returns: OnboardOptions