MultipeerServiceBrowser

Discovers peers that are advertising over Apple's MultipeerConnectivity framework on the same Wi-Fi network or Bluetooth PAN.

The browser is paired with a MultipeerPeerLinkFactory: the factory owns the MCNearbyServiceBrowser and the live MCPeerID map, and the browser exposes a transport-agnostic Flow<Tag> for the consumer.

On Apple and JVM, collectors of either feed share one browse session: the first starts browsing, the last stops it. Each discovery collector receives the current peer set before live arrivals. Keep at least one feed collected while joining a discovered peer, since invitations use the browser that discovered it.

Implementations live in appleMain; jvmMain wraps the dylib + JNA bridge.

Constructors

Link copied to clipboard
expect constructor(factory: MultipeerPeerLinkFactory)

Properties

Link copied to clipboard
expect open override val kind: DiscoveryKind

Functions

Link copied to clipboard
expect open override fun departures(): Flow<String>

Declared here, not left to the actuals, because PeerDiscoverySource no longer defaults it: an expect class must implement every abstract member it inherits, so each platform has to state what its leave signal is. The Apple and JVM actuals have one; the Android and wasmJs stubs return emptyFlow(), having no MultipeerConnectivity to hear it from.

Link copied to clipboard
expect open override fun discoveries(): Flow<Tag>