NwLoom

constructor(api: NwApi, serviceType: String, selfId: PeerId = freshPeerId(), policy: DeliveryPolicy = DeliveryPolicy.Reliable, random: Random = Random.Default, weaveTimeout: Duration = DEFAULT_WEAVE_TIMEOUT, wovenPathGrace: Duration = DEFAULT_WOVEN_PATH_GRACE)

Parameters

api

the Network.framework binding (real RealNwApi, or FakeNwApi under test).

serviceType

the Bonjour service type both advertised and browsed; peers with the same type meet.

selfId

this peer's stable identity; defaults to a fresh random UUID (freshPeerId, #1405).

policy

inbound delivery policy for each woven Seam (default DeliveryPolicy.Reliable).

random

source of the seam's per-connection dedup nonces; production defaults to Random.Default, tests inject a seeded Random for a deterministic dedup tiebreak.

weaveTimeout

how long weave waits for the first peer before throwing NwUnreachableException (default DEFAULT_WEAVE_TIMEOUT). Injectable (#1447 item 1) so a "wait for a friend" lobby can pass a generous value and hold the session open far longer than the default; deliberately NOT infinite by default. Tests inject a small value.

wovenPathGrace

how long a path-lost (ready → waiting) connection is given to recover before the woven seam tears it as CloseReason.Unreachable (#1478); default DEFAULT_WOVEN_PATH_GRACE (10s), injectable for tests.