RemoteConnection

class RemoteConnection(types: Set<ProjectionType>, limits: RemoteLimits = RemoteLimits(), send: (ByteArray) -> Unit) : AutoCloseable(source)

Protocol negotiation and ordered transport for one authenticated connection, confined to its execution owner. The adapter supplies authenticated bytes and synchronous transport writes, never arbitrary peers. The fixed bootstrap limits apply until both greetings have been sent; thereafter both sides use their intersection. All partial buffers and the transport callback are released on close or protocol failure.

Constructors

Link copied to clipboard
constructor(types: Set<ProjectionType>, limits: RemoteLimits = RemoteLimits(), send: (ByteArray) -> Unit)

Types

Link copied to clipboard
object Companion

Stable channel and wire-version identifiers shared by platform adapters.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun discardSession(identity: Long)

Releases unsent work for a terminal session, retaining only ordered cancellation for an already started fragment group. Callers must separately send its typed Close notification; active business actions are never coalesced.

Link copied to clipboard
fun flush(maxFrames: Int = 8)

Flushes at most maxFrames queued frames, bounding work and transport pressure per adapter tick.

Link copied to clipboard
fun receive(bytes: ByteArray, nowMillis: Long): RemoteMessage?

Accepts one frame and returns only complete post-negotiation application messages. The first peer greeting is consumed here; a repeated greeting or premature application message is rejected.

Link copied to clipboard
fun send(message: RemoteMessage)

Sends one application message after successful capability negotiation. Queue exhaustion fails the connection explicitly; actions are never dropped silently.

Link copied to clipboard
fun start()

Sends the one bootstrap greeting once the underlying play connection can carry custom payloads.

Link copied to clipboard
fun tick(nowMillis: Long)

Applies assembly and negotiation deadlines even when the peer sends no more fragments.