fakeRoomPair
suspend fun fakeRoomPair(hostId: PeerId = PeerId("host"), joinerId: PeerId = PeerId("joiner")): Pair<FakeRoom, FakeRoom>
Build a wired pair of FakeRooms whose FakeRoom.broadcast calls cross-deliver into the other room's Room.incoming, matching the behaviour of a real two-peer room.
Each side's roster is seeded with the other as a Liveness.Connected.
A FakeRoom.broadcast on one side delivers a RoomFrame into the other's Room.incoming.
The broadcast is also recorded in the sender's FakeRoom.broadcasts list.
Delivery is synchronous — no separate coroutine substrate required.
val (host, joiner) = fakeRoomPair(PeerId("host"), PeerId("joiner"))
host.broadcast(byteArrayOf(1, 2, 3))
val frame = joiner.incoming.first() // RoomFrame(sender=PeerId("host"), payload=[1,2,3])Content copied to clipboard