Package-level declarations

Types

Link copied to clipboard
interface Connection

A point-to-point, message-oriented duplex link between exactly two peers.

Link copied to clipboard
object Hello

The one-shot identity preamble: the first frame on a handshaking link.

Link copied to clipboard
interface Mesh : Seam

A Seam over a fully-connected N-peer mesh of point-to-point Connections, with support for admitting links that arrive after construction.

Functions

Link copied to clipboard
suspend fun handshaking(conn: Connection, selfId: PeerId, dispatcher: CoroutineContext): Seam

A 2-peer Seam for transports that do NOT carry identity out of band. Sends a Hello preamble as the first frame, awaits the peer's preamble, then delegates to identified over the same single collection of Connection.incoming. Suspends until the peer's preamble arrives.

Link copied to clipboard
fun identified(conn: Connection, selfId: PeerId, remoteId: PeerId, dispatcher: CoroutineContext): Seam

A byte-transparent 2-peer Seam over a Connection whose two identities are known. broadcast == sendTo(remoteId). Woven at construction; Torn on conn EOF/error or close. Concurrent sends are serialized through an internal channel + single writer so wire order matches call order.

Link copied to clipboard
suspend fun meshSeam(selfId: PeerId, connections: List<Connection>, dispatcher: CoroutineContext, random: Random = Random.Default): Mesh

Build a fully-connected N-peer mesh Seam from a set of raw point-to-point connections.