MultipeerRoomHost

class MultipeerRoomHost(loom: Loom, sessionConfig: Pattern) : AutoCloseable

Multipeer-Connectivity room host. Wraps a Loom and a Pattern, opens a host session via SeamRoomFactory, and exposes it as a single Room.

Single-room lifecycle: one MultipeerRoomHost hosts one session.

Lifecycle:

Frame routing, per-peer addressing, and membership tracking are owned by Room — the manual demux that MCLeaderListener carried before :kuilt-session existed is gone.

JNA dylib note: this class is pure-commonMain Kotlin over Loom/Room. It has no native-code path. The MultipeerPeerLinkFactory dylib basenames and JNA constants are unchanged and outside the scope of this class.

Constructors

Link copied to clipboard
constructor(loom: Loom, sessionConfig: Pattern)

Functions

Link copied to clipboard
open override fun close()

No-op. Lifecycle is owned by the calling kotlinx.coroutines.CoroutineScope: cancelling the scope tears start down via structured concurrency.

Link copied to clipboard
suspend fun start(onRoom: suspend (Room) -> Unit)

Start hosting a room. Builds the Room via SeamRoomFactory.host, invokes onRoom once with the live room, then suspends until the calling scope is cancelled.