Peer

interface Peer : PeerToPeerConnection

A Peer represents a remote peer, and the associated PeerToPeerConnection. Peers have a lifecycle, and may be cancelled when they're not reachable anymore.

Functions

Link copied to clipboard
abstract fun cancel()

Cancels the Peer, and stops all its synchronisation jobs.

Link copied to clipboard
abstract suspend fun receiveCatching(): ChannelResult<String>

Attempts to receive a message from the peer.

Link copied to clipboard
abstract suspend fun sendCatching(message: String): ChannelResult<Unit>

Attempts to send a message to the peer.

Properties

Link copied to clipboard
abstract val identifier: PeerIdentifier

The unique PeerIdentifier for this Peer.